0

I'm still a beginner in the PHP so I need your help ... I have a small database Containing

  • id & content & links

I want to retrieve the content data using the id . so I need the php code which could help me

2
  • 2
    Plz send me teh codez ? There are plenty tutorials out there on how to do this. Try doing a few, and if you run into an actual problem, people here will be happy to help you. Commented Sep 26, 2010 at 9:10
  • php.net/manual/en/book.mysql.php happy reading. Commented Sep 26, 2010 at 9:14

3 Answers 3

2
<?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.

Sign up to request clarification or add additional context in comments.

Comments

0

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/

Comments

0

Object oriented approaches:

PDO:

ADOdb:

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.