MySQL Forums
Forum List  »  PHP

Re: please help me to query
Posted by: JOSEPH MAINA
Date: July 07, 2008 11:06AM

Hi Mohamed. I'm not quite sure I get the question. But if you are seeking the SELECT syntax, try this:

<?php
// You connect to your database:
mysql_connect("loacalhost", "yourftplogin", "yourftppassword") or die(mysql_error());
//connect to your database:
mysql_select_db("nameofyourdatabase") or die(mysql_error());
//now you will query your database for the variables you want, and store this
//query in a variable. We will specifically query for the 'id' field:
$sql=mysql_query("SELECT id FROM form");
//if the above query is not successful, display an error message to the visitor:
if(!sql){
die(mysql_error());
}

//From here you can now recall your query and use it at any other point in the
//script.


?>

Options: ReplyQuote


Subject
Written By
Posted
Re: please help me to query
July 07, 2008 11:06AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.