Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.