Jump to content

[SOLVED] recognising a value after but not recognising it before?


shadiadiph

Recommended Posts

I hasve this script in place it redirects to the correct page updates the tblproddetails and inserts into the upload table but in the upload table it isn't recognising the $adid keeps posting the value as 0 whereas on the redirect header it sends the $adid value?

 

		$insertsql = " insert into tblproddetails (type, account, memlevel, category, subcategory, intAccountID, title, description, qtyavailable, unitprice, minorder, deliveryterms, timeterms, paymentterms, countrylocation, viewed, credibility) values ('$type', '$account', '$memlevel', '$cat', '$subcat','$accountid', '$title', '$description', '$quantity', '$unitprice', '$minorder', '$deliveryterms', '$timeterms', '$paymentterms', '$countrylocation', '0', '0')";


		$DB_site->query($insertsql);
                  $adid= mysql_insert_id();


    if ((($_FILES["form_data"]["type"] == "image/gif")
|| ($_FILES["form_data"]["type"] == "image/jpeg")
|| ($_FILES["form_data"]["type"] == "image/pjpeg"))
&& ($_FILES["form_data"]["size"] < 250000))
  {
  if ($_FILES["form_data"]["error"] > 0)
    {
    echo "Error: " . $_FILES["form_data"]["error"] . "<br />";
    }
  else
    {
$data = addslashes(fread(fopen($form_data, "r"), filesize($form_data))); 
$result=MYSQL_QUERY("INSERT INTO uploads (description,intProductID,data,filename,filesize,filetype) ". "VALUES 

('$form_description','$data', '$adid' , '$form_data_name','$form_data_size','$form_data_type')"); 
$id= mysql_insert_id(); 





header ("location: viewad.php?adid=$adid");

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.