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
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • 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.