Jump to content


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


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

Share this post

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

Share this post

Link to post
Share on other sites


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.