project168 Posted March 27, 2011 Share Posted March 27, 2011 Hello PHPfreaks members, I want my PHP coding to read/fetch my database's first attribute/entry like the first number of the client in that first row and then fetch it to be shown on PHP so that it will show '1'. How would I do that? Here's the table of my example database (MySQL) I know the command to select the line via the database is this: SELECT * FROM CUSTOMER WHERE CUST_NO=1; Quote Link to comment https://forums.phpfreaks.com/topic/231875-how-to-use-php-to-readfetch-the-databases-first-attributeentry/ Share on other sites More sharing options...
Tuk Posted March 27, 2011 Share Posted March 27, 2011 $select = mysql_query("SELECT * FROM CUSTOMER WHERE CUST_NO=1"); $array = mysql_fetch_array($select); echo $array['CUST_NO']; This will display '1' in this case. Quote Link to comment https://forums.phpfreaks.com/topic/231875-how-to-use-php-to-readfetch-the-databases-first-attributeentry/#findComment-1192936 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.