Cannibal_Monkey Posted February 28, 2007 Share Posted February 28, 2007 Could somone write a sample code that would retrieve a from row 1 of table b in database c. So far I have <?php $connection=mysql_connect("localhost","root","") or die ("You're dead1"); $db=mysql_select_db("c",$connection) or die ("You're dead2"); $query=mysql_query($a); ?> I'm not sure if that's all correct though, I mean to do what I want to do. Quote Link to comment Share on other sites More sharing options...
gin Posted February 28, 2007 Share Posted February 28, 2007 I suggest this tutorial for database connection: http://www.phpfreaks.com/tutorials/142/0.php The query to get the most recent row of data would be: SELECT * FROM b LIMIT 1 The MySQL & PHP manuals are invaluable resources. Quote Link to comment 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.