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;
<?php mysql_connect('localhost','username','password'); mysql_select_db('database name'); $get = mysql_query('SELECT * FROM CUSTOMER LIMIT 1'); $row = mysql_fetch_assoc($get); echo "Customer No :".$row['CUST_NO']."<br />"; echo "Customer First Name :".$row['CUST_FNAME']."<br />"; echo "Customer Last Name :".$row['CUST_LNAME']."<br />"; echo "Customer Phone :".$row['CUST_PHONE']."<br />"; ?> Code (markup): This will display the 1st record in the database.
thank you for replying. How would I implement to this coding: <?PHP exec("mode com8: BAUD=9600 PARITY=n DATA=8 STOP=1 to=off dtr=off rts=off"); $fp =fopen("com3", "w"); fwrite($fp,"[B]x[/B]");[B] //WRITE TO THE CUSTOMER # BY REPLACING X[/B] fclose($fp); ?> Code (markup): Basically, fwrite writes the data to my USB device so 'x' is my customer # which I want it to fetch from my database. How would I do this?