Jump to content

urgent help...


vonnero

Recommended Posts

I am not sure where the problem is..... but still cant get it to work... Please 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";

}

Link to comment
https://forums.phpfreaks.com/topic/145552-urgent-help/
Share on other sites

Well almost 5 hours later, hope that is urgent enough *rollseyes*

 

CREATE TABLE friendslist (id INT AUTO_INCREMENT, requestorid INT not null,requestedid INT not null,requestedate TIMESTAMP not null, response varchar(10) null, PRIMARY KEY (`id`))

 

Should fix the problem. If you had this:

$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") or die(mysql_error());

 

You may have been able to solve it on your own. Alternatively thoroughly learning SQL Create Table would have helped you tremendously. I would suggest reading up on that or even buying a "SQL For Dummies" book to learn at least the basics of SQL.

Link to comment
https://forums.phpfreaks.com/topic/145552-urgent-help/#findComment-764260
Share on other sites

thanks for all the responses... it gives me a blank page but I copied the SQL part of it to mysql command line monitor and it worked from there..........

 

 

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);.........

 

I am not sure why BUT thanks everyone...!!

Link to comment
https://forums.phpfreaks.com/topic/145552-urgent-help/#findComment-764385
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.