Jump to content

Recommended Posts

hmm thanks for the help...

 

i am writing a SQL file can you use this in the file?

 

like:

 

INSERT INTO `table` (`field1`) VALUE ('something');

INSERT INTO `table` (`field1`) VALUE ('something') WHERE mysql_insert_id();

mysql_insert_id is php, so its easier to write this in php

 

$query = "INSERT INTO `table` (`field1`) VALUE ('something', 'somethingelse')";
$result = mysql_query($query) or die(mysql_error());
$returnid = mysql_insert_id();
$query = "INSERT INTO `table` (`field1`, `field2`) VALUE ('something', '$returnid')";
$result = mysql_query($query) or die(mysql_error());

ah gotcha... i am writing a Joomla (BOOOO) component and to install the file you have to write a sql file to install of the content and menu structure and its a pain in the butt. And the Joomla Forums suck! You can never get any help!

 

Thanks for your help here man!

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.