urgent help...

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
vonnero
Forum Newbie
Posts: 17
Joined: Tue Feb 17, 2009 6:19 am

urgent help...

Post by vonnero »

i am unable to get this code to work... I am not sure where the problem is... plase assist... thanks:

$dbh=mysql_connect("localhost","user","password");

if($dbh)
{
echo "Connected to MySql Server<Br>";
}
else
{
echo mysql_error();
}



$select=mysql_select_db("students");


if($select)
{
echo "database selected<br>";
}

$query=mysql_query("CREATE TABLE friendslist (id INT AUTO_INCREMENT PRIMARY KEY, requestorid INT not null,requestedid INT not null,requestedate TIMESTAMP not null, response varchar(10) null");

if($query)
{
echo "Tables created";
}
User avatar
susrisha
Forum Contributor
Posts: 439
Joined: Thu Aug 07, 2008 11:43 pm
Location: Hyderabad India

Re: urgent help...

Post by susrisha »

Code: Select all

 
[color=#FF0000]$select=mysql_select_db("students");[/color]
$select=mysql_select_db("students",$dbh);
[color=#FF0000]$query=mysql_query("CREATE TABLE friendslist (id INT AUTO_INCREMENT PRIMARY KEY, requestorid INT not null,requestedid INT not null,requestedate TIMESTAMP not null, response varchar(10) null");[/color]
$query=mysql_query("CREATE TABLE friendslist (id INT AUTO_INCREMENT PRIMARY KEY, requestorid INT not null,requestedid INT not null,requestedate TIMESTAMP not null, response varchar(10) null",$dbh);
 
Post Reply