Clinton Posted January 6, 2009 Share Posted January 6, 2009 My scripts been working just fine and all of a sudden this popped up: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '9‡Nßoñ P»>XožžbRé:hárP¢ñýýý^5˜Éd' at line 1 I couldn't figure it out so I reverted back to a previously saved page that I know worked but I'm still getting the same error. I'm not sure why since the page is submitting to itself. ??? ANy ideas? Link to comment https://forums.phpfreaks.com/topic/139718-solved-i-have-no-idea/ Share on other sites More sharing options...
kenrbnsn Posted January 6, 2009 Share Posted January 6, 2009 It looks like there is corruption in your file. Ken Link to comment https://forums.phpfreaks.com/topic/139718-solved-i-have-no-idea/#findComment-731005 Share on other sites More sharing options...
Clinton Posted January 6, 2009 Author Share Posted January 6, 2009 But i reverted back to an old file. Where is the corruption? In the db? The localhost? What a pain. Link to comment https://forums.phpfreaks.com/topic/139718-solved-i-have-no-idea/#findComment-731007 Share on other sites More sharing options...
revraz Posted January 6, 2009 Share Posted January 6, 2009 Without seeing the code for the php file that does the query, hard to say. If you show us that maybe we can help. Link to comment https://forums.phpfreaks.com/topic/139718-solved-i-have-no-idea/#findComment-731008 Share on other sites More sharing options...
Clinton Posted January 6, 2009 Author Share Posted January 6, 2009 Everything works up until it goes to insert it in the db and then it errors out. If the form is submitted, which submits to itself, and there is an error it echos out just fine. It's just when it goes to insert and, like I said, this is brand new. :-/ <?php session_start(); include 'connect/project.htm'; if(($_SESSION['logged_in'] == 1) && ($_SESSION['access_type'] == e)) { $uid = mysql_real_escape_string($_SESSION['user_id']); $query = mysql_query("SELECT * FROM employers WHERE username = '$uid'"); $row = mysql_fetch_assoc($query); extract($row); ?> <html> <head> <title>Welcome back <?php echo $prefix;?> <?php echo $lname;?></title> <link href="images/favicon.ico" rel="shortcut icon" type="image/x-icon" /> <link rel="stylesheet" href="singlec.css" type="text/css" /> <link rel="stylesheet" href="constant.css" type="text/css" /> <SCRIPT> function clearDefaultandCSS(el) { if (el.defaultValue==el.value) el.value = "" } </SCRIPT> <style type="text/css"> #dhtmltooltip{ position: absolute; width: 150px; border: 2px solid black; padding: 2px; background-color: lightblue; color: darkblue; visibility: hidden; z-index: 100; /*Remove below line to remove shadow. Below line should always appear last within this CSS*/ filter: progid:DXImageTransform.Microsoft.Shadow(color=gray,direction=135); } </style> </head> <body> <div id="dhtmltooltip"></div> <script type="text/javascript"> /*********************************************** * Cool DHTML tooltip script- © Dynamic Drive DHTML code library (www.dynamicdrive.com) * This notice MUST stay intact for legal use * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code ***********************************************/ var offsetxpoint=-60 //Customize x offset of tooltip var offsetypoint=20 //Customize y offset of tooltip var ie=document.all var ns6=document.getElementById && !document.all var enabletip=false if (ie||ns6) var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : "" function ietruebody(){ return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body } function ddrivetip(thetext, thecolor, thewidth){ if (ns6||ie){ if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px" if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor tipobj.innerHTML=thetext enabletip=true return false } } function positiontip(e){ if (enabletip){ var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft; var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop; //Find out how close the mouse is to the corner of the window var rightedge=ie&&!window.opera? ietruebody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20 var bottomedge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20 var leftedge=(offsetxpoint<0)? offsetxpoint*(-1) : -1000 //if the horizontal distance isn't enough to accomodate the width of the context menu if (rightedge<tipobj.offsetWidth) //move the horizontal position of the menu to the left by it's width tipobj.style.left=ie? ietruebody().scrollLeft+event.clientX-tipobj.offsetWidth+"px" : window.pageXOffset+e.clientX-tipobj.offsetWidth+"px" else if (curX<leftedge) tipobj.style.left="5px" else //position the horizontal position of the menu where the mouse is positioned tipobj.style.left=curX+offsetxpoint+"px" //same concept with the vertical position if (bottomedge<tipobj.offsetHeight) tipobj.style.top=ie? ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-offsetypoint+"px" : window.pageYOffset+e.clientY-tipobj.offsetHeight-offsetypoint+"px" else tipobj.style.top=curY+offsetypoint+"px" tipobj.style.visibility="visible" } } function hideddrivetip(){ if (ns6||ie){ enabletip=false tipobj.style.visibility="hidden" tipobj.style.left="-1000px" tipobj.style.backgroundColor='' tipobj.style.width='' } } document.onmousemove=positiontip </script> <div id="tail"> <div class="main"> <div id="top"> <div id="logo"> <a href="index.php"><img src="images/logo.png" alt="" /></a> </div> <div class="right"> <div id="topmenuposition"> </div> <div id="topmenu"> <div class="module_s10"> <div> <div> <div> <ul class="menu-nav"> <li class="item60"><a href="index.php"><span><em>Home</em></span></a></li> <li class="item29"><a href="aboutus.php"><span><em>About Us</em></span></a></li> <li class="item54"><a href="resources.php"><span><em>Resources</em></span></a></li> <li class="item55"><a href="press.php"><span><em>Press/Media</em></span></a></li> <li class="item56"><a href="contact.php"><span><em>Contact Us</em></span></a></li></ul> </div> </div> </div> </div> </div> </div> </div> <div id="header"> <div class="bg-right"> <div class="bg-left"> <div class="space"><img src="images/banner.png" alt="" /></div> </div> </div> </div> <? if (isset($_POST['Submit'])) { $errors = array(); ///Checks for Errors/// if (!empty($_POST['jtitle'])) { $jtitle = $_POST['jtitle']; } else { $errors[] = '<font color="red">You did not fill out this field.</font>'; } if (!empty($_POST['dtype'])) { $dtype = $_POST['dtype']; } else { $errors[] = '<font color="red">You did not fill out this field.</font>'; } if (!empty($_POST['dmajorp'])) { $dmajorp = $_POST['dmajorp']; } else { $errors[] = '<font color="red">You did not fill out this field.</font>'; } if (!empty($_POST['cinfo'])) { $cinfo = $_POST['cinfo']; } else { $errors[] = '<font color="red">You did not fill out this field.</font>'; } if (!empty($_POST['city'])) { $city = $_POST['city']; } else { $errors[] = '<font color="red">You did not fill out this field.</font>'; } if (!empty($_POST['state'])) { $state = $_POST['state']; } else { $errors[] = '<font color="red">You did not fill out this field.</font>'; } if (!empty($_POST['status'])) { $status = $_POST['status']; } else { $errors[] = '<font color="red">You did not fill out this field.</font>'; } if (!empty($_POST['wexperience'])) { $wexperience = $_POST['wexperience']; } else { $errors[] = '<font color="red">You did not fill out this field.</font>'; } if (!empty($_POST['poverview'])) { $poverview = $_POST['poverview']; } else { $errors[] = '<font color="red">You did not fill out this field.</font>'; } if (!empty($_POST['pduties'])) { $pduties = $_POST['pduties']; } else { $errors[] = '<font color="red">You did not fill out this field.</font>'; } if (!empty($_POST['pqual'])) { $pqual = $_POST['pqual']; } else { $errors[] = '<font color="red">You did not fill out this field.</font>'; } if (!empty($_POST['salary'])) { $salary = $_POST['salary']; } else { $errors[] = '<font color="red">You did not fill out this field.</font>'; } if (!empty($_POST['benefits'])) { $benefits = $_POST['benefits']; } else { $errors[] = '<font color="red">You did not fill out this field.</font>'; } if (!empty($_POST['reloassist'])) { $reloassist = $_POST['reloassist']; } else { $errors[] = '<font color="red">You did not fill out this field.</font>'; } if (!empty($_POST['jobdecisiondate'])) { $jobdecisiondate = $_POST['jobdecisiondate']; } else { $errors[] = '<font color="red">You did not fill out this field.</font>'; } if (!empty($_POST['contactname'])) { $contactname = $_POST['contactname']; } else { $errors[] = '<font color="red">You did not fill out this field.</font>'; } if (!empty($_POST['contactnumber'])) { $contactnumber = $_POST['contactnumber']; } else { $errors[] = '<font color="red">You did not fill out this field.</font>'; } if (!empty($_POST['contactemail'])) { $contactemail = $_POST['contactemail']; } else { $errors[] = '<font color="red">You did not fill out this field.</font>'; } extract($_POST); if (empty($errors)) { $query = "INSERT INTO thelist (username, jtitle, dtype, dtypewc, dmajorp, dmajorc1, dmajorc2, dmajorc3, cname, cinfo, clogo, city, state, status, wexperience, wexperiencewc, careerlevel, contactname, contactnumber, contactemail, poverview, pduties, pqual, salary, benefits, reloassist, jobdecisiondate, extra, applyat) VALUES ('$username', '$jtitle', '$dtype', '$dtypewc', '$dmajorp', '$dmajorc1', '$dmajorc2', '$dmajorc3', '$cname', '$cinfo', '$clogo', '$city', '$state', '$status', '$wexperience', '$wexperiencewc', '$careerlevel', '$contactname', '$contactnumber', '$contactemail', '$poverview', '$pduties', '$pqual', '$salary', '$benefits', '$reloassist', '$jobdecisiondate', '$extra', '$applyat')"; ////IF THE JOB POSTS SUCCESFULLY//// ?> <div id="breadcrumb"> <div class="module_breadcrumb"> <div> <div> <div> <span class="breadcrumbs pathway"> <? $result = @mysql_query($query); ///IF I VIEW PAGE SOURCE THIS IS WHERE THE ERROR IS SHOWING/// if (mysql_affected_rows() == 1) { ?> Congratulations <?php echo $prefix;?> <?php echo $lname;?>. </span> </div> </div> </div> </div> </div> <div id="wrapper"> <div class="indent"> <div id="right"> <?php include 'mmenu.php'; ?> <?php include 'linmenu.php'; ?> </div> <div id="content"> <div class="content-tl"> <div class="content-tr"> <div class="width"> <div id="boxes"> <div id="box1"> <div class="module"> <div class="first"> <div class="sec min-height"> <div class="box-indent"> <div class="width"> <h3><span>Now What?</span></h3> <table width="95%" border="0" cellspacing="0" cellpadding="1" class="boxtitle"> <thead> <tr> <td>Post another?<br /> </td> </tr> </thead> <tr><td> <a href="emember.php">Click Here</a>. </td></tr> </table> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> <div id="footer"> <div class="bg"> <div class="right-bg"> <div class="left-bg"> <div class="space"> © 2009 </div> </div> </div> </div> </div> </body> </html> Link to comment https://forums.phpfreaks.com/topic/139718-solved-i-have-no-idea/#findComment-731014 Share on other sites More sharing options...
Clinton Posted January 6, 2009 Author Share Posted January 6, 2009 I might have figured it out... which might bring me to another question... Link to comment https://forums.phpfreaks.com/topic/139718-solved-i-have-no-idea/#findComment-731019 Share on other sites More sharing options...
Clinton Posted January 6, 2009 Author Share Posted January 6, 2009 Ok, it was the $clogo. Each organization within our office has their own logo and I was trying to take it from the users table and stick it in with the information table. It was reading the binary logo and echoing that so when it went to insert it into the db it was erroring out. I'll just recall the logo from the users table and go about it that way I guess. Link to comment https://forums.phpfreaks.com/topic/139718-solved-i-have-no-idea/#findComment-731025 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.