bluecat Posted April 13, 2006 Share Posted April 13, 2006 Hi there, can anyone please help with this one?I'm trying to deliver a single record result in a detail page from a master page result using php & mySQL. I get the following 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 'LIMIT 0, 1' at line 1There must be something wrong with my code..<?php require_once('Connections/vinyl.php'); ?><?php$maxRows_genre = 12;$pageNum_genre = 0;if (isset($HTTP_GET_VARS['pageNum_genre'])) { $pageNum_genre = $HTTP_GET_VARS['pageNum_genre'];}$startRow_genre = $pageNum_genre * $maxRows_genre;$colname_genre = "1";if (isset($HTTP_GET_VARS['recordID'])) { $colname_genre = (get_magic_quotes_gpc()) ? $HTTP_GET_VARS['recordID'] : addslashes($HTTP_GET_VARS['recordID']);}mysql_select_db($database_vinyl, $vinyl);$query_genre = sprintf("SELECT * FROM vinyl WHERE vinyl_id = %s", $colname_genre);[b]$query_limit_genre = sprintf("%s LIMIT %d, %d", $query_genre, $startRow_genre, $maxRows_genre);[/b]$genre = mysql_query($query_limit_genre, $vinyl) or die(mysql_error());$row_genre = mysql_fetch_assoc($genre);Can anyone spot any errors here?Many Thanksbluecat Quote Link to comment https://forums.phpfreaks.com/topic/7294-dreamweaver-mx-master-detail-sql-syntax/ Share on other sites More sharing options...
moberemk Posted April 13, 2006 Share Posted April 13, 2006 Was this all generated by Dreameaver, or did you edit any of it? Because to show only one record, all you have to do is not apply a repeat region. Quote Link to comment https://forums.phpfreaks.com/topic/7294-dreamweaver-mx-master-detail-sql-syntax/#findComment-26538 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.