Jump to content

Dreamweaver MX - Master Detail - SQL Syntax


Recommended Posts

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 1

There 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 Thanks
bluecat
Link to comment
https://forums.phpfreaks.com/topic/7294-dreamweaver-mx-master-detail-sql-syntax/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.