|
|  | Mindanao Bloggers in General Santos Tour |
Link: http://ice9web.co.cc/Ice 9 Web Company with Chili Cool ideas this blog is more information than personal insights talks about management, peers and blogging events Finally the long wait has ended. The Bibles arrived on May 28, 2008 via LBC. These Bibles I ordered from RJ, since I have been searching all over the city of Davao to buy a New King James version authored by Thomas Nelson, but the only available was the smallest Bible NKJV and the rest was either Catholic Bibles and Old King James versions. RJ ordered it from Amazon and I paid him using bank deposit, at first I have had a hard time what Bibles to choose, since all of them are very interesting and pretty. Anyway, I wanted one that is portable and has everything including maps etc... Oh! some of the descriptions in Amazon are not accurate because the New King James version large print we chose (as indicated in the picture at Amazon) it has maps etc... but unluckily it wasn't. Anyway it is still a Bible, RJ wanted me to give a discount of P500 pesos from choosing a wrong Bible, but I told him “its ok” (I thought) since I was also involve in choosing the said item so whatever the billing he gets I should pay for it.  

My lesson learned; always verify from the original site; for example we chose the Thomas Nelson NKJV Large Print, I must check the code item at Thomas Nelson website to make sure that the indicated descriptions at Amazon is accurate. Here are the screen-shots:



I didn't regret buying all these Bibles since you can never easily find them here in our City locally, if so, it might have cost me more than 3k, because the smallest Bible available (3inches by 5inches) )in the store I saw already cost around P800 pesos, maybe the large print (9.7inches by 8inches) would cost around 2k. The portable pocket edition from NIV is very cool!, the (duo) colored Italian leather feel so smooth and real. Its really worth buying and the paper is not that thin... galing nga eh! (^_^) sobrang ganda If you're wondering how much I have spent from all of these Bibles, well its around 2k I can't give the exact amount as my transaction with RJ is not yet finalize (I did deposit around 2k to his account but he told me he will return the excess money if from his billing on June will charge less than the amount I deposited). In the near future I might buy the Giant Print NKJV from Thomas Nelson, that has everything including the maps, concordance, family tree, etc... this time I will verify it from the Thomas Nelson website to be very sure. As for now again the long wait has ended, I told myself am not going to buy any gadgets until the Bibles will arrive, so now I guess my dream of buying a new cellphone, laptop or digital Cam will be my next agenda. (^_^) ahihihi  | Bibles | May 29, '08 12:48 AM for everyone |
|  | ordered Bibles |
Here's another blogging power: a tool to get JUSTICE; it was on ABS-CBN news last night and I was surprise on how Brian Gorrell can get so much attention tru blogging. . . The Brian Gorrell case: Blogging as a tool to get 'justice'
Some of his posts that I copied on his blog
This blog has come full circle. In a short period of time. Its amazing for me.
Even though I have yet to get my money back, my other objective has been met. Everyone knows that DJ Montano scammed me for 70,000 dollars. ITS A FACT. I have the proof.
The blog has been a surprise sensation. For all of us. The first television interview aired tonight. The response has been huge. Thank you for the support.
I have been contacted by bloggers all over the world. We are all amazed at the growth of my blog. It proves so many things about humanity as a whole. We protect each other when we see a wrong being done. We rally around the helpless, defenceless and scared. People frightened by others. Scared into submission.
Blogging will help change that. It already has. But it will only get bigger and better. Information is the key to the future. Newspapers will vanish soon. As they should.
Bloggers have really gathered around me these past few weeks. I owe them so much. Their advice. The endless encouragement. Their links. The help.
The exposure of my story on television has given my experience validity and the credibility it deserves.
Thank you ABS/CBN for looking closely at my facts and acting accordingly.
Being interviewed was strange. But the film crew was beautiful and made the entire thing very easy. I am a very private person. But I am happy with the outcome. Gigi was VERY good to me, as was her assistant. Thank you Gigi for treating this story with respect and consideration.
I am overwhelmed by my fellow bloggers. I have to keep saying it. I know how hard they worked to get the word out regarding my plight. Thank you very much.
Bloggers unite! Safety in numbers.
No more anonymous comments. Be counted please.
I will go to jail. NOT YOU!
Bloggers are changing the face of the world. Blogs are a very real alternative to traditional forms of media. We go to them for information. We decide what we will take away as truth. What is deception.
We have entered a new world. A much more open world. More inclusive. Less oppressive.
We all have opinions. We all need to be heard. Blogging offers anyone with access to a computer the opportunity to put their message out into cyberspace.
So people like DJ Montano have to be careful now.
Because you never know when when someone will start a blog on you. If you deserve one.
So keep your noses clean. Treat others with respect and dignity. Love your neighbours. Respect your friends and lovers. Don't steal. Don't cheat. Try not to lie.
Because no one deserves it. No one deserves to lose everything at the hands of your boyfriend. And nowadays, you could just wake up one morning and your dirty laundry is all over the Internet.
On a blog. A blog about you.
So be good.
DJ, you still owe me 70,000 dollars. When are you going to give it back?
No more anonymous posts. Leave your name. Its private. I have the courage. So should you.
More posts tomorrow.
Now, do you want to know the link of his blog? click here
addthis_url=''; addthis_title=''; addthis_pub='icelahora';
~~~
Finally after 3 weeks of studying and learning PHP and MySQL its finish now
http://egolfplay.com/aice/menu/ that is the link to my job well done that I got 96 This link is only available up to October this year it is just a temporary host
addthis_url=''; addthis_title=''; addthis_pub='icelahora';
This link is sweet and funny (^_^) the doggy is cute try to type walk sing kiss dance roll check it out...
http://www.idodogtricks.com/index_flash.html
see what it do if you type
hug run eat
addthis_url=''; addthis_title=''; addthis_pub='icelahora';
~~~
Graduation! hmmm Congrats to all the 2008 Graduates. This may differ from all of my previous post, it is just that I can't get it off my mind so I guess will write it here to remind us what we are IN for this world... the planet called Earth. The two students were drinking their last beer after the Seniorsâ Prom marking their graduation. The following day their class would scatter to the four corners of the country. So this was their last beer until their classâs official homecoming ten years hence. The moment was almost solemn for Jonathan Richmond and Charlie Quarter. And, although they had never been very close during the preceding four years (their values and lifestyle were too contrasted to allow for deep friendship between them), nevertheless they felt the special significance of this time of separation...âAll right, Jonathan,â Charlie said, âIâm ready to bet that when we meet in ten yearsâ time, Iâll be three times riches than youâll be.â Such a statement was pure Charlie Quarter. For it expressed perfectly the young manâs extremely competitive nature. Not just because Charlie was ready to bet on anything (he said it make life so much more interesting), but because he loved to humiliate his opponents by delivering them a crushing defeat whenever possible. And unfortunately, he was as unscrupulous as he was ruthless. As long as he won, he didnât care what means he used to achieve his goal. Jonathan Richmond, on the other hand, always preferred cooperation to competition. Or if one insisted on using the term âcompetition,â he would always soften it into the expression âfriendly competition.â Moreover, Jonathan was about the closest thing you could ever find to a really honest man. To his upright nature, deceit and crooked means were as unthinkable as a flash of lightning in a blue sky. And so, he felt no inclination to take up his classmate on the latterâs cocky bet, in the feat that such a bet would only incite him to be even more unscrupulous in the next ten years. However, since he didnât want to offend Charlie during their last minutes together, he tactfully rephrased his companionâs proposal.
âWell, Charlie,â he replied with a friendly laugh, âyou know Iâm not much of a gambler. Never had the nerves for it. But maybe in ten years we can compare notes and see if both of us have made good, each in his line of business. Hopefully, we will have. And Iâll be the first one to drink a toast to your success, my friend.â This conversation proved to be the two young menâs last contact until the homecoming ten years later. In the mean time each launched on in different directions, directions that differed with regard to their business careers and, even more so, with regard to their spiritual evolution.
Charlie Quarter began his career by opening a modest retail store with a partner. They sold computer equipment both hardware and software. Within a year, though, Charlie had managed to defraud his partner of his share of the business. Then he joined forces with another, bigger retailer, whom he likewise succeeded in swindling out of the partnership, thus ending up a wealthy man. After that he entered the manufacturing segment of the computer world and began producing equipments for his own chain of stores. From then on he contrived, by hook or by crook, to eliminate most of his competitors, forcing them out of the business by the most ruthless and dishonest means possible: industrial espionage, personnel raiding, labor unrest, and so on. Unfortunately for him, though, his unethical tactics eventually backfired against him. He was accused of breaking the copyright laws enshrined in the computer Software Act of 1980. Just before the date of the class homecoming around, he lost about everything he owned in a lawsuit. And so it was very chasten Charlie who faced Jonathan after their ten yearsâ separation.
The latter entered the business world with only one thing in mind: the service of the public. Being a deeply committed Christian, he had completely made his the teaching of Jesus on service: âyou know that among the pagans the rulers lord it over them and their great man make their authority felt. This is not to happen among you. No; anyone who wants to be great among you must be your servant, and anyone who wants to be first among you must be your slave, just as the Son of Man came not to be served but to serve, and to give his life as a ransom for manyâ (Mt 20, 26-28).
And so, imbued with the sole concern of serving the public, he looked around for ways and means of achieving his aim. Now, it so happened that at the particular time a website developing company, Angels on Vines, was on the verge of bankruptcy. Jonathan bought it, put it back on its feet, and soon transformed it into the most thriving concern in the entire Websites industry expanding in the process into a vast network of branches and offices, worldwide. How the young man achieved all this was direct result of his idealism, integrity and profound respect for his employees (whom he always called âassociatesâ). Here are some of the methods he used in this connection.
First of all, from the very first day of his takeover of Angels on Vines, he stressed quality. To his stockholders he said year after year: âQuality is the first word in our motto. Growth is not our principal goal. Our goal is to be quality organization and do a quality job, which means that we will be proud of our work and products for years to come. As we achieve quality, growth will come as a result.â With Jonathan at the helm, Angels on Vines became obsessed with quality. You asked officials at the companyâs headquarters about personnel, they would talk quality; you asked about sales, they would talk quality; you asked about management, they would talk quality.
In this respect Jonathan had a simple philosophy: he wanted to give the best company service of any company in the world. To this end Angels on Vines guaranteed answering any customers complain in twenty-four hours. Jonathan read every complaint Email personally and answered it personally. His company guaranteed quality websites in all over the country and the whole world.
Towards his personnel Jonathan always acted with the utmost respect and consideration. Thus he insisted that at all levels of the organization all members were made aware of their essential contribution to the overall success of Angels on Vines. They were to be treated as adults and as partners, with dignity and respect. This meant that employees, once they wholeheartedly shared the values of service and quality at the heart of the companyâs working principles, were given a wide scope of practical autonomy to get the job done. New ideas and new forms of experimentation were welcome, all this with a high tolerance of failure for those who risked innovations. All important communications were made face to face. Workers were given opportunity for career education, security in their positions, and easy access to any superiors. Finally, employees received constant âpositive reinforcementâ by means of incentives and rewards of all kinds: pens badges, buttons, medals, a ten percent bonus for a weekâs punctuality, a âgold circleâ for top sales persons, special âjubileesâ for outstanding performers, honorary stars for no-absence months, and so on. In other words Jonathan provided initiative, direction, meaning he created among his âassociatesâ a sense of excitement, of exuberance, a sense of being part of the best, a sense of creating something of quality that they could be proud of. And they were. For indeed, as Jonathan often stated publicly: âAt Angels on Vines, we only make Websites; but itâs the best in the world. And so, the public is served and God is honored.â
It is in such a context that Charlie and Jonathan met again. Naturally, the latter was far too considerate to remind his classmate of their erstwhile resolution to âcompare notesâ and, even less, of Charlieâs bet of tripling Jonathanâs worth. No, given his exquisitely Christian tact, Jonathan could not allow himself to gloat over his former classmateâs failure (even though richly deserved) or even allude to it.
This attitude of Jonathan took Charlie by surprise. He had expected at least a few oblique and ironical references to his fiasco. He got none. On the contrary, he sensed that Jonathan wasnât in the least judgmental towards him, that he was in fact discreetly supportive and sympathetic. And this set him thinking. He had already begun to revise his entire philosophy of life, acknowledging that ruthless competition was unproductive in the long run. Perhaps, he mused, Jonathanâs approach was better than his? Anyway, it certainly worked better!
To cut short a long story, at the end of the homecoming Jonathan, sensing his classmateâs change of heart, graciously invited Charlie to come and work for him. The latter accepted with gratitude, aware that life â or was it God? - was giving him a second chance. He wouldnât miss this one!
HAPPY EASTER SUNDAY! (^_^)
addthis_url=''; addthis_title=''; addthis_pub='icelahora';
~~~
I just passed by one blog that says about works etc... and here was the result in my test
Your Job Dissatisfaction Level is 42%
|

Well, you don't have the worst job in the world, but it's not great.
And don't worry, you're not the problem - your company is.
Start looking around for another job, even if you're not totally fed up.
Because in time, you're going to be dying to quit!
|
I wouldn't call it 100% true... maybe 10% quite true... well the reason for it... hmmm i will post on my Aice Nice Concepts... just wait and see... ^_^ oh by the way... at the moment I don't have any plans of quitting my job... I love what I'm doing sometimes I don't feel like working at all but we are all but human beings that sometimes we get tired specially of negative feedback... but anyway if there is negative there will be positive ^_^
addthis_url=''; addthis_title=''; addthis_pub='icelahora';
 The Chaplet of the Divine Mercy is a Roman Catholic devotion based on the visions of Polish nun/saint, Sister Faustina Kowalska, known as the "Apostle of Mercy", 1905-1938. According to Sister Faustina's visions, written in her diary, the chaplet's prayers for mercy are threefold: to obtain mercy, to trust in Christ's mercy, and to show mercy to others. Sister Faustina's vision: Jesus Christ promised that all who recite this chaplet at the hour of death or in the presence of the dying will receive great mercy. It consists of a series of prayers said with the aid of rosary beads. The chaplet may be said without beads, typically by counting prayers on the fingertips. Jesus said, ".... When they say this Chaplet in the presence of the dying, I will stand between My Father and the dying not as the just judge but as the Merciful Savior". Sister Faustina recounts in her diary that, in her vision, she saw an angel sent to a city to destroy it. Sister Faustina began to pray for God's mercy on the city and felt the strong presence of the Trinity. After she prayed the internally-instructed prayers, the angel was powerless to harm the city. In subsequent revelations, Sister Faustina learned that the prayers she spoke were to be taught to all the people of the world. Jesus also promised that anything can be obtained with this prayer if it is compatible with His will. It is prayed daily at the National Shrine of The Divine Mercy in Stockbridge, MA.
To Roman Catholic tradition, the chaplet may be prayed at any time, but most effective on Divine Mercy Sunday and Fridays at 3:00 PM. In 2000, Pope John Paul II ordained the Sunday after Easter Divine Mercy Sunday, where Roman Catholics remember the institution of the Sacrament of Penance.
The hour Jesus died by crucifixion, 3:00 PM (15:00), is called the Hour of Mercy. In novena, the chaplet is usually said each of the nine days from Good Friday to Divine Mercy Sunday.
The chaplet is associated with a Polish image painted by Adolf Hyla. Hyla painted to the visions Sister Faustina. In the image, Jesus stands with a hand outstretched in blessing. The other hand clutches the side wounded by the spear, from which proceed beams of falling light. The words âJesus I Trust in Youâ usually accompany the image (âJezu Ufam Tobieâ in Polish).
addthis_url=''; addthis_title=''; addthis_pub='icelahora';
~~~
March 17 Araw ng Davao... May 30% additional?
Hmmm Araw ng Davao week that started around March 10 to 17 culminate on the 16th weeeiii!!! our local holiday (Araw ng Dabaw / Kadayawan sa Dabaw) (^_^) ano kaya meron kaya 30% additional? hey sana mag comment naman kayo please please please to know more about Araw ng Davao...The 71st Araw ng Dabaw (Davao Day) has evolved into a celebration of the Dabaweñosâ oneness. It is a vibrant feast held every March 16 and together with the Kadayawan, ranks as Davao City's biggest annual event.
This yearâs theme is âKasaysayan Balikan, Ihanda Kinabukasan.â (Learn from the Past, be ready for the Future)
DATU BAGO AWARDS This award is named after Datu Bago, a local chieftain who tried to repulse Spanish encroachment in Davao. BANDA HUDYAKA One of the highlights of the Araw ng Dabaw which will feature a musical band parade competition and showdown along the main streets of Davao City. MUTYA NG DABAW Davao's Official Beauty Pageant. Showcases some of the most beautiful women that the city has to offer. As the only official tabulator of the Mutya ng Dabaw 2008, Digilution has also created a support website of the search for smart and talented Dabawenyas (www.mutyangdabaw.com).
Digilution has also created various informative and effective websites for local and international companies, such as the Davao Business Directory, Kadayawan sa Dabaw Festival, Retirement Plantations, Hite Concrete, Grand Regal Hotel, John Gold Travel, BlueKnight Directory, Davao Doctors Hospital, Miss Teen Philippines, Pinoytel, Kasuotan, Jonnahrealty, GlitterWorks, Bongreen Corporation, African Asian Travel, Ayo Wonderoil, Crafters Haven Davao, Hismahills, Chateau del Mar Resort, Papa Lench, Eastbright, the newly reconstructed and improved Davao City Tourism website (www.davaotourism.com) among many others.
addthis_url=''; addthis_title=''; addthis_pub='icelahora';
~~~
Sony Ericsson keeps wowing us with product after product. Their latest flagship of technical prowess is the W960i. The Sony Ericsson W960i has all gadget lovers could giggle about... It has 3.2 mega pixel camera with autofocus, photo light, 8GB of internal storage, and all shoehorned into that slick exterior finish called âBlack Vinyl. What a beauty! Now that Sony Ericsson W960i is already out in the market, iâm just wondering which is better, the P1 or the W960i. Theyâre almost identical in functionality but targets a different market of consumers.
Design
At the back, the soft-touch plastic gives the handset a smooth velvety feel. One just has to hold the P1i. The W960i feels lighter probably due to the plastic compared with the metallic finish on the P1i. The two devices have almost identical dimensions and weight, though the choice of materials used is different.
When we tilt the phone at an angle with the bottom edge toward us, the reflective coating of the numerals and letters on the keypad stands out significantly. The W960i is predominantly black with a white strip running around the sides, which reminds us of a penguin. It looks nice, but doesn't serve any practical purpose. We also noticed that the white backlighting on the keypad is uneven, with most of the light concentrated at the center column.
Above that is the 2.6-inch 240 x 320-pixel touchscreen LCD that is flush with the surface. The screen is protected by a layer of plastic, so you are not actually poking at the display. What we are more concerned with is the glossy vinyl black surface that catches smudges and facial oils.
There are three touch-sensitive music playback keys between the keypad and the LCD on the W960i. These are visible only when the Walkman player is active. Unlike the LG Prada phone which uses a capacitive display, meaning it could register finger strokes but not stylus input, we could use both methods to control the three music keys on the W960i.
Like we mentioned earlier, the W960i has near identical physical dimensions as the P1i, but the similarity doesn't end there. The two also share the same 208MHz processor and 128MB of RAM. More on the performance later.
One thing that left a bad aftertaste was the Back button at the front, which should have been at the side together with the jog dial. We couldn't find a better way to describe it other than that it kills the whole user experience. While we could still use one hand to operate the handset, our thumb has to move back and forth. That was counter-intuitive, occasionally awkward, and at times frustrating.
The W960i promises a lot as a music player, but unfortunately, isn't quite the complete package as we thought it could be. It doesn't have a built-in 2.5/3.5mm audio port. Perhaps we are used to having such an option, especially on some of the Nokia Nseries sets. We thought it's about time Sony Ericsson does some justice to its Walkman phones as well. That said, our review set comes with a 3.5mm adapter. We just didn't like the hassle of dealing with the extra length of cable.
The handset's menu is very similar to some of the touchscreen models we've seen like the M600i and P1i. The default user theme shows the Walkman player on the screen. That can be turned off if desired. Menu options that appear on the bottom of the 2.6-inch screen change according to the different settings. While we managed to get away with using our finger or thumb on the panel most of the time, typing a text message via the onscreen keyboard still requires a stylus. The latter is stowed away on the top left corner. Speaking of which, we wondered if Sony Ericsson could have bundled a more solid (metallic) stylus instead of a plastic one that looks like a steal at a bargain store.
Because there's no directional keypad or joystick on the W960i, navigating the Walkman interface requires the use of the jog dial. The menu icons are lined in a column with the usual sorting by artists, albums, compilations, tracks and playlists. There's also a Moods option where songs can be tagged to the different tempo of the music, for example, happy, sad, energetic or chilled. This lets us pick one that suits our mood for the day.
On the connectivity front, the triband W960i is 3G-enabled (UMTS 2100) and equipped with Bluetooth with A2DP support and Wi-Fi. Other features on this Symbian UIQ Walkman include FM radio with RDS, an Opera Web browser, support for RSS feeds, TrackID and organizer functions.
Although it's from the Walkman series, the W960i isn't a minion when it comes to digital imaging. It has a 3.2-megapixel autofocus camera with a pair of LED photolights. Pictures can go up to a maximum resolution of 2,048 x 1,536 pixels and videos in QVGA at 15fps. The video part was a bit of a disappointment since there are smart phones on the market that are capable of shooting motion images in VGA resolution at 30fps. There's also a secondary front-facing camera for 3G video calls.
Performance
Unlike the P1i, we didn't find the W960i particularly responsive. The slowdown was even more obvious when the 8GB memory started to reach its limit. There are two modes to choose from after we connect the W960i to the PC: Normal or Fast file transfer. For the latter, the W960i will show up as a flash drive, so copying of files to the handset is only a matter of dragging and dropping. Alternatively, Sony Ericsson also provides the media manager software to manage music files on the unit.
The W960i ships with a standard 950mAh Lithium-polymer cell that's rated for 9 hours of talktime and about 15 days on standby. In real-world conditions, the battery life performance was dismal. With our usual pattern of making calls, sending text messages and listening to music during commute, the cell gave up on us in less than 1.5 days. Be prepared to charge it every night if you don't want to worry about it dying mid-day.
The W960i takes average-quality pictures which most people would find okay. In terms of performance, there's a 0.6-second shutter lag, though that shouldn't matter that much as long as the hand is kept steady when pressing the shutter. The only gripe we have is that the camera interface didn't have one of those rectangular boxes that light up in green to show that the camera is focused and ready. Instead, the small icon on the bottom left does that. To sum it up, there's still work to be done on the UI of the camera.
Conclusion
We found the onboard speakers pleasant and up to par. We didn't expect any lesser since that's a flagship model from the Walkman pedigree. Pairing to our stereo cans via Bluetooth A2DP happened without a hitch. We guess that's one way of avoiding the cables using the 3.5mm adapter.
So was the hype around the W960i justified? On paper, yes. Did it meet our expectations? No. The W960i may be one of the most elaborate music-phones we've seen, but is most unfortunately bogged down by several issues--poor location of Back button, lack of a built-in 3.5mm audio port, dismal battery life and laggy performance.
Hmm! Sony Ericsson W960i instead of a P1? Hayz will wait for the price to go down again ^_^
addthis_url=''; addthis_title=''; addthis_pub='icelahora';
~~~
Nothing much to post except for the fact I'm very busy coping with PHP and MySQL might as well post it here for my reference in this way I will not have a hard way of searching my documents etc.. Connecting To The Database
The first thing you must do before you can do any work at all is to connect to the MySQL database. This is an extremely important step as, if you are not connected, your commands to the database will fail.
Good practice for using databases is to specify the username, password and database name first so that if you change any of them at a later date you will only have to change one line:
$username="username"; $password="password"; $database="your_database";
At this point you may be wondering if it is a security risk, keeping your password in the file. You don't need to worry, though, because the PHP scource code is processed aby the server before being sent to the browser so it is impossible for the user to see the script's source.
Next, you will need to issue the command to start a database connection:
mysql_connect(localhost,$username,$password);
This line tells PHP to connect to the MySQL database server at 'localhost' (localhost means the server that the site is running one. Unless you web host tells you otherwise you should use localhost. If you are given a server address (such as sql.myserver.com you should replace localhost with "sql.myserver.com" (including the quotes)) using the username stored in $username and the password in $password.
Before I show you how to work with the database, I will show you one more command:
mysql_close();
This is a very important command as it closes the connection to the database server. Your script will still run if you do not include this command but too many open MySQL connections can cause problems for a web host. It is good practice to always include this line once you have issued all your commands to the database, to keep the server running well.
Selecting The Database
After you have connected to the database server you must then select the database you wish to use. This must be a database to which your username has access. The following command:
@mysql_select_db($database) or die( "Unable to select database");
is used to do this. This tells PHP to select the database stored in the variable $database (which you set earlier). If it cannot connect it will stop executing the script and output the text:
Unable to select database
This extra 'or die' part is good to leave in as it provides a little error control but it is not essential.
Executing Commands
Now you have connected to the server and selected the database you want to work with you can begin executing commands on the server.
There are two ways of executing a command. One is to just enter the command in PHP. This way is used if there will be no results from the operation.
The other way is to define the command as a variable. This will set the variable with the results of the operation.
In this part of the tutorial we will use the first way as we are not expecting a response from the database. The command will look like this:
mysql_query($query);
The useful thing about using this form of the command is that you can just repeat the same command over and over again without learning new ones. All you need to do is to change the variable.
Inserting Data
For this part of the tutorial I will return to the contacts database which we created in the last part. We will now add our first information to the database:
First: John Last: Smith Phone: 01234 567890 Mobile: 00112 334455 Fax: 01234 567891 E-mail: johnsmith@gowansnet.com Web: http://www.gowansnet.com
This will all be put in with one command:
$query = "INSERT INTO contacts VALUES ('','John','Smith','01234 567890','00112 334455','01234 567891','johnsmith@gowansnet.com','http://www.gowansnet.com')";
This may look a little confusing at first so I will explain what it all means.
Firstly $query= is there because we are assigning this to the variable $query (see the section above). The next part:
INSERT INTO contacts VALUES
is quite easy to understand. It tells the PHP to insert into the table called contacts the values in the brackets which follow.
The part in the brackets contains all the information to add. It uses all the fields in order and inserts the information from between the quotes. For example:
John
will be inserted into the 2nd field which, in this table, is the 'first' field.
You may have noticed that you are not inserting any value into the first field in the database (id). This is because this field is going to act as an index field. No two records in the database will have the same ID. Because of this, when we set up the database we set ID to 'Auto Increment'. This means that if you assign it no value it will take the next number in the series. This means that this first record will have the ID 1.
HTML Input
Inputing the data using HTML pages is almost identical to inserting it using a PHP script. The benefit, though, is that you do not need to change the script for each piece of data you want to input and you can also allow your users to input their own data.
The following code will show an HTML page with textboxes to enter the appropriate details:
This page could, of course, be formatted and have other changes made to it. It is just a basic form to get you started. Next you will need to edit the script from last week. Instead of using information to input into the database, you will instead use variables: $username="username"; $password="password"; $database="your_database";
$first=$_POST['first']; $last=$_POST['last']; $phone=$_POST['phone']; $mobile=$_POST['mobile']; $fax=$_POST['fax']; $email=$_POST['email']; $web=$_POST['web'];
mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( "Unable to select database");
$query = "INSERT INTO contacts VALUES ('','$first','$last','$phone','$mobile','$fax','$email','$web')"; mysql_query($query);
mysql_close(); ?>
This script should then be saved as insert.php so that it can be called by the HTML form. It works because, instead of the data being entered locally, it is being entered into the form and stored in variables which are then passed to the PHP.
You could also add to this script a message confirming the data input. This is basic PHP, though, and you should read the PHP tutorial if you do not know how to do this.
Outputting Data
Now you have at least one record, if not many more, in your database you will be wanting to know how you can output this data using PHP. Before beginning, though you should be familiar with loops in PHP (you can find out about them in the tutorial on Free Webmaster Help) as they are used for this way of outputting data.
The first command you will need to use is a MySQL query made up like this:
SELECT * FROM contacts ?>
This is a basic MySQL command which will tell the script to select all the records in the contacts table. Because there will be output from this command it must be executed with the results being assigned to a variable:
$query="SELECT * FROM contacts"; $result=mysql_query($query); ?>
In this case the whole contents of the database is now contained in a special array with the name $result. Before you can output this data you must change each piece into a separate variable. There are two stages to this.
Counting Rows
Before you can go through the data in your result variable, you must know how many database rows there are. You could, of course, just type this into your code but it is not a very good solution as the whole script would need to be changed every time a new row was added. Instead you can use the command:
$num=mysql_numrows($result);
This will set the value of $num to be the number of rows stored in $result (the output you got from the database). This can then be used in a loop to get all the data and output it on the screen.
Setting Up The Loop
nYou must now set up a loop to take each row of the result and print out the data held there. By using $num, which you created above, you can loop through all the rows quite easily. In the code below, $i is the number of times the loop has run and is used to make sure the loop stops at the end of the results so there are no errors.
$i=0; while ($i < $num) {
CODE
$i++; } ?>
This is a basic PHP loop and will execute the code the correct number of times. Each time $i will be one greater than the time before. This is useful, as $i can be used to tell the script which line of the results should be read. As the first line in MySQL output is 0, this will work correctly.
Assigning The Data To Variables
The final part of this output script is to assign each piece of data to its own variable. The following code is used to do this:
$variable=mysql_result($result,$i,"fieldname");
So to take each individual piece of data in our database we would use the following:
$first=mysql_result($result,$i,"first"); $last=mysql_result($result,$i,"last"); $phone=mysql_result($result,$i,"phone"); $mobile=mysql_result($result,$i,"mobile"); $fax=mysql_result($result,$i,"fax"); $email=mysql_result($result,$i,"email"); $web=mysql_result($result,$i,"web"); ?>
We do not need to get the ID field (although we could have done) because we have no use for it in the current output page.
Combining The Script
We can now write a full script to output the data. In this script the data is not formatted when it is output:
$username="username"; $password="password"; $database="your_database";
mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); $query="SELECT * FROM contacts"; $result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
echo "Database Output
";
$i=0; while ($i < $num) {
$first=mysql_result($result,$i,"first"); $last=mysql_result($result,$i,"last"); $phone=mysql_result($result,$i,"phone"); $mobile=mysql_result($result,$i,"mobile"); $fax=mysql_result($result,$i,"fax"); $email=mysql_result($result,$i,"email"); $web=mysql_result($result,$i,"web");
echo "$first $last Phone: $phone Mobile: $mobile Fax: $fax E-mail: $email Web: $web
";
$i++; }
Formatting Output
In the last part of the tutorial we output a list of all the people stored in the database. This just gave us a very basic output, though and is not particularly useful for a working website. Instead, it would be better if we could format it into a table and display it like this.
Doing this formatting is not particularly complicated. All you need to do is use PHP to output HTML and include your variables in the correct spaces. The easiest way to do this is by closing your PHP tag and entering the HTML normally. When you reach a variable position, include it as follows:
in the correct position in your code.
You can also use the PHP loop to repeat the appropriate code and include it as part of a larger table. For example, using a section of the code from part 4 which looped to output the database you can format it to display it in one large table:
Name |
Phone |
Mobile |
Fax |
E-mail |
Website |
|---|
?>
$i=0; while ($i < $num) {
$first=mysql_result($result,$i,"first"); $last=mysql_result($result,$i,"last"); $phone=mysql_result($result,$i,"phone"); $mobile=mysql_result($result,$i,"mobile"); $fax=mysql_result($result,$i,"fax"); $email=mysql_result($result,$i,"email"); $web=mysql_result($result,$i,"web"); ?>
|
|
|
|
E-mail < /a> |
Website |
$i++; } echo " ";
?>
This code will print out table headers, then add an extra row for each record in the database, formatting the data as it is output.
As long as you are familiar with PHP and HTML the code is probably pretty self explanatory but I will just point out the last two lines in the table, for example:
E-mail
This shows one of the useful features of using PHP to include MySQL data as you can use it to output parts of your code and make pages fully dynamic.
Selecting Pieces of Data
As well as showing the whole database, PHP can be used to select individual records, or records which match certian criteria. To do this you must use a variation of the SELECT query. To display the whole table we used the query:
SELECT * FROM contacts
If we just wanted to select ones who had the first name 'John' you would use the following query:
SELECT * FROM contacts WHERE first='john'
As with other MySQL queries, it is almost like plain english. In the same way you could select records based on any field in the database. You can also select ones with more than one field by adding more:
field='value'
sections onto the query.
Although I won't go int o great depth about it in this section, you can also use variables to give the database criteria. For example, if you had a search form you could get the last name people wanted to search for and store it in a variable called $searchlast. Then you could execute the following piece of code:
$query="SELECT * FROM contacts WHERE last='$searchlast'"; $result=mysql_query($query);
Please note that at the end of the first line there is a ' followed by a " before the semicolon.
Security
At this point it should be noted that you must be very careful in using the technique given above. Without correct secuirty measures, it would be very easy for someone to access data on your server, or even make changes to the database. This can occur if the user sets the variable to a value which edits the SQL string being generated in such a way that it can be used for their own purposes. I won't go into full details here, but there are many websites which give full details (search for 'sql injection attack').
This security hole is easy to plug with a bit of work. Always check input data for invalid chanracters and use PHP's built in functions to remove control characters and HTML code etc. Again, there are many websites which go into this in depth.
* * *
Error Trapping
By outputting all the information from the database, it is quite unlikely that there will be no data, but if you allow updating and deleting of records, it is certainly a possibility. Luckily, with PHP and MySQL, there is an easy way round this using:
$num=mysql_numrows($result);
where $result contains the result of a query on the database (like selecting all the records). As I expalined before, this will set the value of $num as the number of rows in the result (and it was used in a loop in part 4). Because of this you can make a simple error trap using an IF statement:
if ($num==0) { echo "The database contains no contacts yet"; } else { Output Loop }
?>
You can expand on this more by making it more user friendly (for example by providing a link to the Add Data page if no contacts exist).
Ordering Data
Not only can you output data based on the contents of a field, but you can also order the output based on a field (for example placing users in alphabetical order). By default, the output from your queries will be in order of the id field, going from 1 upwards. You can sort it on any field, though.
For example, a useful sort would be to place all the users in alphabetical order based on their last name. For those not familiar with standard databases, this would be in Ascending order as it goes from A to Z. (Ascending order is also for 1-10 etc. and descending order provides Z to A and 10-1). To do this you would use the following query:
SELECT * FROM contacts ORDER BY last ASC
You could also use DESC to order the data in Descending order.
More Uses Of mysql_numrows and Sorting
The value you have assigned to $num is very imiportant as, apart from error trapping and loops, it has many other uses. An example of this would be to print out only the last 5 records added to a database. Firstly, they would need to be placed into order based on the id field (as the one with the latest ID would have been added last. This would require them to be in Descending order.
Now you have them in order of newest to oldest but this does not restrict the script to only showing the first 5. To do this, you would need to set your loop to run to 5 instead of $num (as this would only run the loop 5 times so only 5 records would be output).
Of course, before doing this, it would be important to check that $num was greater than 5, as if you ran the loop 5 times and there were only 3 rows you would get an error. This is easy to do though and the following code is an example of the sort of thing you would want to have:
if ($num>5) { $to=5; }else{ $to=$num; }
$i=0; while ($i < $to) { REST OF CODE
?>
This code would check if there were more than 5 rows in the database. If there were, the loop would be set to run 5 times. If there were less than 5 rows the loop would run the correct number of times to output the whole database.
The ID Field
If you remember back to creating the database for the contacts at the beginning of this tutorial, you will remember that we included a numerical field called id. This field was set as auto_increment as well as being the primary field. I have already explained how this field is unique for every single record in the database, but I will now take this a stage further by explaining how this can be used to select an individual record from a database.
Selecting A Single Record
At the end of the last part of this tutorial, I s howed you how to select records from the database based on the contents of partiular fields using:
SELECT * FROM contacts WHERE field='value'
Now, by using the unique ID field we can select any record from our database using:
SELECT * FROM contacts WHERE id='$id'
Where $id is a variable holding a number of a record. This may seem to be a little worthless as it is, but you can use this very effectively in a number of different ways. For example, if you wanted to have a dynamically generated site run through a database and a single PHP script, you could write the script to include the database data into the design. Then, using the id field, you could select each individual page and put it into the output. You can even use the page's URL to specify the record you want e.g.
http://www.yoursite.com/news/items.php?item=7393
And then have the PHP script look up the record with the id corresponding to $item, which in this case would be 7393
Links For Single Records
Using this method of choosing a record using the URL to select the record can be expanded further by generating the URL dynamically. This sounds a bit complicated so I will elaborate. In the contacts script we are writing, I will be showing you how to create an Update page where the user can update the contact details.
To do this, another column will be included in the output column, with an Update link in it. This update link will point to a page allowing the user to update the record. To select the record in this page, we will put:
?id=$id
By getting the id of the record along with the other information when we are outputting the information from the database, this code will create a link which has each record's ID number in it. Then, on the update page, there can be code to just select this item.
The Update Script
By using the $id variable you output links which would pass the correct ID to the script so that it can update the database. Using this you can then create the update script, which will actually have two sections to it.
Displaying The Update Page
The first part of the update script uses the single record selection from last week but adds a little HTML to it to make it more useful. First of all, we connect to the database and select the appropriate record.
$id=$_GET['id']; $username="username"; $password="password"; $database="your_database"; mysql_connect(localhost,$username,$password);
$query=" SELECT * FROM contacts WHERE id='$id'"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close();
$i=0; while ($i < $num) { $first=mysql_result($result,$i,"first"); $last=mysql_result($result,$i,"last"); $phone=mysql_result($result,$i,"phone"); $mobile=mysql_result($result,$i,"mobile"); $fax=mysql_result($result,$i,"fax"); $email=mysql_result($result,$i,"email"); $web=mysql_result($result,$i,"web");
Space For Code
++$i; } ?>
Where 'Space For Code' is in this script is where the code for the update page will go. This is, in fact, just HTML formatting for the output:
As you can see, this code will output a standard form, but instead of having blank boxes like on the form for inserting a new record, this one already has the current information from the database inserted into it. This makes it much more effective for an update script.
Updating The Database
The next stage of this script is to actually update the database. This is a simple operation and just involves a new query for the database:
$query = "UPDATE contacts SET first = '$ud_first', last = '$ud_last', phone = '$ud_phone', mobile = '$ud_mobile', fax = '$ud_fax', email = '$ud_email', web = '$ud_web' WHERE id = '$ud_id'";
This query tells the database to update the contacts table where the ID is the same as the value stored in $ud_id (which as you can see from the form on the previous page was set as the id of the record we are updating) and to set the following fields to the specified values (which were set using the form on the previous page).
This query could then be integrated into a simple script:
$ud_id=$_POST['ud_id']; $ud_first=$_POST['ud_first']; $ud_last=$_POST['ud_last']; $ud_phone=$_POST['ud_phone']; $ud_mobile=$_POST['ud_mobile']; $ud_fax=$_POST['ud_fax']; $ud_email=$_POST['ud_email']; $ud_web=$_POST['ud_web'];
$username="username"; $password="password"; $database="your_database"; mysql_connect(localhost,$username,$password);
$query="UPDATE contacts SET first='$ud_first', last='$ud_last', phone='$ud_phone', mobile='$ud_mobile', fax='$ud_fax', email='$ud_email', web='$ud_web' WHERE id='$ud_id'"; mysql_query($query); echo "Record Updated"; mysql_close();
This code would update the database and give the user a confirmation.
Deleting Records
The final part of the contacts database which needs to be created is a page to delete records. As with the Update page, this should have a record ID sent to it in the URL e.g.:
delete.php?id=9
The code to do this is the same as to update the database, except with a slightly different MySQL query. Instead of the UPDATE query you should use:
DELETE FROM contacts WHERE id='$id'
This would then be used with the connection and confirmation code as above.
Loops
At this time it seems appropriate to mention another use of loops with a database. As well as using a loop to get information from a database as we have before, you can also use loops to execute queries. For example, if you wanted to change all the records in the database with the last name Smith to have the website www.smith.com:
Standard Database Connection Code
$query=" SELECT * FROM contacts WHERE last='Smith'"; $result=mysql_query($query); $num=mysql_numrows($result);
$i=0; while ($i < $num) { $id=mysql_result($result,$i,"id"); $query1="UPDATE contacts SET web='http://www.smith.com' WHERE id='$id'"; mysql_query($query); ++$i; }
mysql_close();
Of course, this could have been achived far easier and quicker using:
$query1="UPDATE contacts SET web='http://www.smith.com' WHERE last='Smith'";
and no loop.
* * *
Saving Time
When creating complex scripts using databases you will find that the most common thing you are doing is connecting to a database. Because of this, you can actually save time by creating either a username/password file or a connection file. For example for a username/password file you would create a file called:
dbinfo.inc.php
and put the following in it:
$username="databaseusername"; $password="databasepassword"; $database="databasename"; ?>
Replacing the appropriate sections. Then in your php files use the following code:
include("dbinfo.inc.php");
or
include("/full/path/to/file/dbinfo.inc.php");
at the beginning. Then, you can use the variables $username, $password and $database throughout your scripts without having to define them every time. Also, if you ever change this information, for example if you move to another web host, there is only one file to change.
You can use the same principal to connect to the database, by putting the connection code in the file, but you must always be sure to close the connection in each file or you may have problems with your MySQL server.
Searching
A limited form of searching can also be performed on your database using a built in MySQL function. This is by using the LIKE function as follows:
SELECT * FROM tablename WHERE fieldname LIKE '%$string%'
To explain furhter, LIKE tells the database to perform its 'searching' feature. The % signs mean that any other data could appear in their place and $string would hold your search string. In this place could be a word or number as well e.g.:
LIKE '%piano%'
which would output any rows with piano in the specified field.
Similarly, you can leave out one of the % signs so that you can specify the position of the string e.g.:
LIKE 'piano%'
Will only output rows where the specified field begins with piano, so:
The piano is next to the table.
Would not show up.
The Finished Script
Throughout this tutorial I have given you pieces of code to make a contacts database script. You can download the full script as a zip file so that you can examine the code (see Related Links).
Conclusion
From this tutorial you should now know the basics of using PHP and MySQL together to create database-enabled websites and programs. Using databases with the web opens up a huge new selection of things you can do and can make a simple website much more powerful, saving time updating the site, allowing user interaction and feedback and much more.
addthis_url=''; addthis_title=''; addthis_pub='icelahora';
~~~
Working on none working holiday with extra 30% pay ... no work no pay addthis_url=''; addthis_title=''; addthis_pub='icelahora';  | Guestbook | |
 | Daan lang, ehehehe =}  |
 |
tanom wrote on Dec 22, '08 |
 | Multiply hopping!!!~ ^^, TC always and God bless! ^^ |
 |
tanom wrote on Oct 31, '08 |
 |
tanom wrote on Dec 20, '07 |
 |
tanom wrote on Oct 30, '07 |
 |
tanom wrote on Oct 19, '07 YOU'RE IT!! YOU HAVE BEEN CONSIDERED ONE OF MY SWEETEST FRIENDS ON MY LIST onCE YOU HAVE BEEN TAGGED YOU HAVE TO TAG 5 OF YOUR SWEETEST FRIENDS AND LET THEM KNOW THEY ARE SWEET X.X.X"" FAKE FRIENDS: Will ignore this Send this 2 at least 5 ppl including me if u care 4 me!!! ....oooO............... .....(....)................ ......)../....Oooo..... .....(_/.....(...)........ ..............(_/......... ........................... ......oooO............... .....(....)................ ......)../....Oooo..... .....(_/.....(....)....... ...............)../........ ..............(_/......... ........................... ......oooO............... .....(....)................ ......)../....Oooo..... .....(_/.....(....)....... ...............)../........ ..............(_/......... ........................... ... I WAS ............. .......... HERE ...... ..Leaving my ....... Footprints in your ..............SAND" If you wake up in a red room with no windows and doors, DON'T panic.. you're just in my heart!!! Send this to all the friends you want to keep forever... Send this to all of your friends, and me if I am one. If you get 7 back you are LOVED!!! Here are the numbers of what kind of friend you are based on how many you get back.. 1-3 ~ you're a friend 4-6 ~ you're an okay friend 7-9 ~ you're a good friend 10+ ~ you're great friend |
 | Salamat sa pagbalik ^_^ Mark |
 |
tanom wrote on Jul 14, '07 waaaaa.. ako ulit bumalik..wahahhaah |
 | hay salamat nag comment din si Jehz ^_^ |
 | yey! salamat din nitrosaint ^_^ |
 |
tanom wrote on Jun 22, '07 yehey! ako nauna sa guestbook! yepey! |
|