Jump to content


Photo

Dreamweaver MX - Master Detail - SQL Syntax


  • Please log in to reply
1 reply to this topic

#1 bluecat

bluecat
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 13 April 2006 - 10:24 AM

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);
$query_limit_genre = sprintf("%s LIMIT %d, %d", $query_genre, $startRow_genre, $maxRows_genre);$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


#2 moberemk

moberemk
  • Members
  • PipPipPip
  • Advanced Member
  • 695 posts

Posted 13 April 2006 - 11:23 AM

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.
Disclaimer: No matter how harsh I may be, I'm always IMO only.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users