Jump to content

[SOLVED] syntex error - help


affordit

Recommended Posts

Can someone tell me whats wrong with this it inserts into brands and products but not in categories.

 

Heres the code

 

<?

include("k_falls_dbinfo2.inc.php");

mysql_connect(mysql,$username,$password);

@mysql_select_db($database) or die( "Unable to select database");

 

$query = "INSERT INTO products VALUES ('','$bname','$sphone','$category','$upc','$brand','$model','$description','$extra','$price','$website')";

mysql_query($query);

 

 

#  if the user submitted a CATEGORY

if( isset($category) )

{

  #  get the user id 

  $id = mysql_insert_id( );

 

  #  and insert the CATEGORY details

  $query = "INSERT INTO categories VALUES ('','$category')";

}

if( isset($brand) )

{

  #  get the user id 

  $id = mysql_insert_id( );

  $query = "INSERT INTO brands VALUES ('','$brand')";

  $result = mysql_query( $query );

}

mysql_free_result( $result );

mysql_close();

// -----------------------------

 

?>

Link to comment
https://forums.phpfreaks.com/topic/85677-solved-syntex-error-help/
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.