guymclaren Posted September 17, 2008 Share Posted September 17, 2008 No errors it just does nothing why? $username="xxx"; $password="xxxx"; $database="xxxxx"; $server="xxxx"; mysql_connect($server,$username,$password); @mysql_select_db($database) or die("Unable to select database"); mysql_query (" INSERT INTO affiliates (Company , Contact , domain , email , Tel , Fax , Cell , Address , Postal , Referrer , Confirm , Type , ref2 , ref3 , ref4 , aff_id) VALUES ( '$company', '$fname', '$domain', '$email', '$tel', '$fax', '$cell', '$address', '$postal', '$userid', '0', '$type', '$aff', '$aff1', '$aff2', '$aff3', 'affid')"); Quote Link to comment https://forums.phpfreaks.com/topic/124640-solved-its-official-php-hates-me-connection-issue/ Share on other sites More sharing options...
beansandsausages Posted September 17, 2008 Share Posted September 17, 2008 the @ turn error reporting off i think not too sure though. also if thats the full script where you geting your values from? Quote Link to comment https://forums.phpfreaks.com/topic/124640-solved-its-official-php-hates-me-connection-issue/#findComment-643708 Share on other sites More sharing options...
guymclaren Posted September 17, 2008 Author Share Posted September 17, 2008 Its not the full script, the data is coming from a form. It is getting data because I see that in my results, It just does not insert into the database. I am lost. Quote Link to comment https://forums.phpfreaks.com/topic/124640-solved-its-official-php-hates-me-connection-issue/#findComment-643712 Share on other sites More sharing options...
beansandsausages Posted September 17, 2008 Share Posted September 17, 2008 post the full script Quote Link to comment https://forums.phpfreaks.com/topic/124640-solved-its-official-php-hates-me-connection-issue/#findComment-643713 Share on other sites More sharing options...
guymclaren Posted September 17, 2008 Author Share Posted September 17, 2008 if ($coid != NULL) { $aff = $coid; $fname = $_REQUEST['fname']; if ($fname != NULL) { $company = $_REQUEST['company']; $domain = $_REQUEST['domain']; $type = $_REQUEST['type']; $address = $_REQUEST['address']; $postal = $_REQUEST['postal']; $tel = $_REQUEST['tel']; $cell = $_REQUEST['cell']; $fax = $_REQUEST['fax']; $email = $_REQUEST['email']; $pay = $_REQUEST['payment']; /* make sure they are all here */ $username="xxx"; $password="xxx"; $database="xxxx"; $server="xxxx"; mysql_connect($server,$username,$password); @mysql_select_db($database) or die("Unable to select database"); mysql_query (" INSERT INTO affiliates (Company , Contact , domain , email , Tel , Fax , Cell , Address , Postal , Referrer , Confirm , Type , ref2 , ref3 , ref4 , aff_id) VALUES ( '$company', '$fname', '$domain', '$email', '$tel', '$fax', '$cell', '$address', '$postal', '$userid', '0', '$type', '$aff', '$aff1', '$aff2', '$aff3', 'affid')"); /* INSERT INTO DATABASE SEND CONFIRMATION EMAIL TO CLIENT */ ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <style> body { font-family :Verdana; font-size: 9pt; text-align: left; text-decoration:none; background-attachment : fixed; background-position : center top; background-repeat : no-repeat; background-color : white; background-image : url(webtech.jpg);} h1 {font-family :Verdana; font-size: 11pt; text-align: left;} a {font-family :Verdana; font-size: 10pt; font_weight: bolder; color: #009999; text-decoration:none; text-align: left;} td { font-family :Verdana; font-size: 10pt; text-align: left; text-decoration:none;} </style> <title>Website order page</title> </head> <body><div align="center"><table summary="" width="770"> <tr> <td> <h1>Success</h1> <?php echo "Dear $fname" ; ?> <br /><br /> Thank you for your order. Due to high levels of spam and in order to confirm your email address we have sent you a confirmation link to the email address you have given us. You will need to visit the link to finalise this transaction and receive payment details. <br /><br />Once we have received your confirmation, signed debit order and proof of payment we will reserve your domain name and install your website within 3 - 4 days. </table> </form> </div> <?php } ?> Quote Link to comment https://forums.phpfreaks.com/topic/124640-solved-its-official-php-hates-me-connection-issue/#findComment-643715 Share on other sites More sharing options...
guymclaren Posted September 17, 2008 Author Share Posted September 17, 2008 OK so what now? Quote Link to comment https://forums.phpfreaks.com/topic/124640-solved-its-official-php-hates-me-connection-issue/#findComment-643738 Share on other sites More sharing options...
Maq Posted September 17, 2008 Share Posted September 17, 2008 Echo all of your variables to make sure they have values. Quote Link to comment https://forums.phpfreaks.com/topic/124640-solved-its-official-php-hates-me-connection-issue/#findComment-643748 Share on other sites More sharing options...
CroNiX Posted September 17, 2008 Share Posted September 17, 2008 Try as Maq suggested. I would rewrite it like so: $query=" INSERT INTO affiliates (Company , Contact , domain , email , Tel , Fax , Cell , Address , Postal , Referrer , Confirm , Type , ref2 , ref3 , ref4 , aff_id) VALUES ( '$company', '$fname', '$domain', '$email', '$tel', '$fax', '$cell', '$address', '$postal', '$userid', '0', '$type', '$aff', '$aff1', '$aff2', '$aff3', 'affid')"; echo $query; mysql_query($query); That will list your exact query so you can check for errors Quote Link to comment https://forums.phpfreaks.com/topic/124640-solved-its-official-php-hates-me-connection-issue/#findComment-643814 Share on other sites More sharing options...
guymclaren Posted September 17, 2008 Author Share Posted September 17, 2008 Thanks, the variables all exist barring 3 which I have not yet created, It still adds nothing to the database, How can I test wether it is actually connecting? Quote Link to comment https://forums.phpfreaks.com/topic/124640-solved-its-official-php-hates-me-connection-issue/#findComment-643979 Share on other sites More sharing options...
imdead Posted September 17, 2008 Share Posted September 17, 2008 mysql_query (" INSERT INTO affiliates (Company , Contact , domain , email , Tel , Fax , Cell , Address , Postal , Referrer , Confirm , Type , ref2 , ref3 , ref4 , aff_id) VALUES ( '$company', '$fname', '$domain', '$email', '$tel', '$fax', '$cell', '$address', '$postal', '$userid', '0', '$type', '$aff', '$aff1', '$aff2', '$aff3', 'affid')") or die(mysql_error()); Quote Link to comment https://forums.phpfreaks.com/topic/124640-solved-its-official-php-hates-me-connection-issue/#findComment-643982 Share on other sites More sharing options...
Zane Posted September 17, 2008 Share Posted September 17, 2008 put the or die extension on the mysql_query function rather than mysql_select_db if the db wasn't selected...mysql_query won't even work, so there's no reason to put an or die on the select db unless you really want to know why...which would most likely be a mispell or a bad permission. so.. try mysql_query("INSERT query blahblah blah") or die("ERROR: " . mysql_error()); Quote Link to comment https://forums.phpfreaks.com/topic/124640-solved-its-official-php-hates-me-connection-issue/#findComment-644004 Share on other sites More sharing options...
guymclaren Posted September 17, 2008 Author Share Posted September 17, 2008 Thank you, I now have input happening YAY. Time for me to check some other stuff before coming back here to ask more noob questions. Who knew PHP was gonna make me feel like I have never coded before. Actually MY ASP skills helped solve one or two problems and I am guessing that the logic at least helps a bit, but these curly brackets and things are verry confusing Quote Link to comment https://forums.phpfreaks.com/topic/124640-solved-its-official-php-hates-me-connection-issue/#findComment-644019 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.