
PHP: Get MYSQL Entry
Started by
gerrydevis
, Jan 09 2010 06:54 AM
1 reply to this topic
#1
Posted 09 January 2010 - 06:54 AM
Register to Remove
#2
Posted 09 January 2010 - 07:48 PM
Have you tried something along the lines of this?
I haven't done PHP+MYSQL for a long time, but that's the gist of general db queries if I remember rightly. Take your time to teach yourself MYSQL - a clever MYSQL query can save you a lot of time/php code.
Hope that helps.
$result = mysql_query("SELECT * FROM MyTable WHERE Species='Alien'"); //validate $result... while ($row = mysql_fetch_assoc($result)) { echo "ID: {$row['id']} - " . "Name: {$row['name']} - " . "Species: {$row['species']}<br>"; } mysql_free_result($result);Assuming you have already established the DB connection, and "MyTable" is the name of your table.
I haven't done PHP+MYSQL for a long time, but that's the gist of general db queries if I remember rightly. Take your time to teach yourself MYSQL - a clever MYSQL query can save you a lot of time/php code.
Hope that helps.
Proud Graduate of the TC/WTT Classroom
At weekends (GMT) I may not be able to reply promptly due to various commitments. Please be patient and I will respond as soon as I can.My help is free, however, if you wish to make a small donation to show appreciation and to help me continue the fight against Malware, then click here

Need help remembering those important computer maintenance tasks? Let SCars do it for you.

0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users