Jump to content

random character string


violinrocker

Recommended Posts

Ok, I am missing something here. What is the subscription part for. If you want to use the forum table with a primary key i would do something along the line of:

$connection = mysql_connect("localhost", "username", "pass");
$sql = "INSERT INTO forums (value1,value2, value3) VALUES ('v1','v2','v3')";
$result = mysql_query($sql,$connection);
$lastId =  mysql_insert_id();


$sql2 = "INSERT INTO subscriptions (forumId,value2, value3) VALUES ('$lastId','v2','v3')";
$result2 = mysql_query($sql2,$connection);

 

Dont forget that if you do use an auto incimenting primary key then you do not need to put it in the insert query.

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.