DamienRoche Posted July 29, 2008 Share Posted July 29, 2008 I am totally confused about how to go about this. Say someone has just entered some details on my web page, they submit and the data is put into a database and assigned a unique id. How do I pull there information in a single row of the table using that id? As in how do I pull data from that particular row, and use the information from the fields separately. I'd love to know what you guys do. Regards, Damien. Link to comment https://forums.phpfreaks.com/topic/117145-retrieving-data-from-mysql/ Share on other sites More sharing options...
waynew Posted July 29, 2008 Share Posted July 29, 2008 <?php $result = mysql_query("SELECT * FROM tablename WHERE id = '$id'") or die(mysql_error()); while($row = mysql_fetch_assoc($result)){ echo $row['col_name']; //or assign to array or something } ?> Link to comment https://forums.phpfreaks.com/topic/117145-retrieving-data-from-mysql/#findComment-602516 Share on other sites More sharing options...
secoxxx Posted July 29, 2008 Share Posted July 29, 2008 http://www.google.com/search?hl=en&q=Retrieving+Data+from+MySQL.+&btnG=Google+Search hundreds of tutorials. Link to comment https://forums.phpfreaks.com/topic/117145-retrieving-data-from-mysql/#findComment-602517 Share on other sites More sharing options...
DamienRoche Posted July 29, 2008 Author Share Posted July 29, 2008 Cheers waynewex I'll try that. Secoxxx, I always search Google first but I'm just not getting this. I'll try the code and carrying on reading guides. Ta Link to comment https://forums.phpfreaks.com/topic/117145-retrieving-data-from-mysql/#findComment-602521 Share on other sites More sharing options...
samshel Posted July 29, 2008 Share Posted July 29, 2008 did you already try some code your self? check out functions mysql_connect() mysql_select_db() mysql_query() mysql_num_rows() mysql_fetch_array() Link to comment https://forums.phpfreaks.com/topic/117145-retrieving-data-from-mysql/#findComment-602534 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.