Reputation: 1
I'm still a beginner in the PHP so I need your help ... I have a small database Containing
I want to retrieve the content data using the id . so I need the php code which could help me
Upvotes: 0
Views: 672
Reputation: 101192
Object oriented approaches:
PDO:
ADOdb:
Upvotes: 0
Reputation: 646
<?php
mysql_connect("localhost", "dbuser", "dbpass");
mysql_select_db("dbname");
$id = 5;
$q = mysql_query("SELECT * FROM table_name WHERE id = {$id}");
$r = mysql_fetch_object($q);
echo $r->links;
?>
Supposing you need to get only one row from table.
Upvotes: 2
Reputation: 30207
if your database is mySQL
read http://www.w3schools.com/PHP/php_mysql_connect.asp
and
http://www.novaksblog.com/2007/10/02/database-connection-with-php/
Upvotes: 0