Willo009 Posted February 2, 2011 Share Posted February 2, 2011 Hi Guys I hope its ok to post here with some problems im having. This is my 1st time with trying to use php, and my 1st time attempting to create a website. Im using some extensions from Webassist, and although they can cut down the time it takes to code php. There also not as stated on there website, and you need too pretty much understand Php too get them working. And i have been banging my head against walls for 6mth in there forum, which only ever seem too send you too w3schools website. In my mind thats not support more being Fobbed Off! I came across this forum and seen there are people out there too help, and everyone here seems to enjoy helping unlike webassist. I have a few problems, my 1st is on the index page. When i run it i get this error 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 ') WHERE id = -1 AND ((type = 'Dog')) AND ((country = 'England')) LIMIT 0, 10' at line 1 i will add the index page for anyone too look at, thanks in advance of any help with this. [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
robert_gsfame Posted February 2, 2011 Share Posted February 2, 2011 AND type='Dog' AND country='England' LIMIT 0, 10 Quote Link to comment Share on other sites More sharing options...
Willo009 Posted February 2, 2011 Author Share Posted February 2, 2011 This is the problem? AND type='Dog' AND country='England' LIMIT 0, 10 its just within the code of my Index page i cannot see this, and how would i go about fixing it? Thanks for your speedy reply on this. Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted February 2, 2011 Share Posted February 2, 2011 post the entire SQL statement. Quote Link to comment Share on other sites More sharing options...
Willo009 Posted February 3, 2011 Author Share Posted February 3, 2011 This is the info below, thanks for your help <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; } $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? doubleval($theValue) : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; } $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? doubleval($theValue) : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } mysql_select_db($database_petsCon, $petsCon); $query_RSsearch = "SELECT * FROM petdata"; $RSsearch = mysql_query($query_RSsearch, $petsCon) or die(mysql_error()); $row_RSsearch = mysql_fetch_assoc($RSsearch); $totalRows_RSsearch = mysql_num_rows($RSsearch); $query_RSsearch = "SELECT * FROM petdata"; $RSsearch = mysql_query($query_RSsearch, $petsCon) or die(mysql_error()); $row_RSsearch = mysql_fetch_assoc($RSsearch); $totalRows_RSsearch = mysql_num_rows($RSsearch); ?> Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted February 3, 2011 Share Posted February 3, 2011 The code you posted isn't the code returning that error. It has to be coming from somewhere else. Quote Link to comment Share on other sites More sharing options...
jamesxg1 Posted February 3, 2011 Share Posted February 3, 2011 Please post the full error (including the "in C:\blah\blah.php"), so we may determine where this error is coming from and whats going on. James. Quote Link to comment Share on other sites More sharing options...
Willo009 Posted February 3, 2011 Author Share Posted February 3, 2011 Thanks Guys for offers off help, this is a great forum. I decided to re-do the pages that were causing me problems, it was a late night but there running just fine now. I have a question though, when passing values from my Results page to my Details page through a URL is the Querystring different because i have INNER JOINED 2 tables? This is my Querystring <a href="DetailsPet.php?id=<?php echo $row_ResultsRS['id']; ?>">Details</a></td> But its not passing on the values, and just shows the 1st results in database all the time. Im only just learning Php, but would i be right in thinking it to do with the 'id' as this is what joins the 2 tables. Do i have to state which 'id' to use? if so how do i do it? Quote Link to comment 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.