shadiadiph Posted December 23, 2008 Share Posted December 23, 2008 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"); Link to comment https://forums.phpfreaks.com/topic/138149-solved-recognising-a-value-after-but-not-recognising-it-before/ Share on other sites More sharing options...
shadiadiph Posted December 23, 2008 Author Share Posted December 23, 2008 ooops solved it already Link to comment https://forums.phpfreaks.com/topic/138149-solved-recognising-a-value-after-but-not-recognising-it-before/#findComment-722148 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.