Jump to content

[SOLVED] Problem with Syntax but I can't see it ??


jaxdevil

Recommended Posts

<?php
$db_host = "localhost";
$db_user = "usice_usice";
$db_pwd = "xxxxxx";
$db_name = "usice_usice";
mysql_connect($db_host, $db_user, $db_pwd);
mysql_select_db($db_name) or die(mysql_error()); 
$query = "SELECT * FROM `products` WHERE mod = '$icemachines' LIMIT 1";
$result = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_array($result);
{
?>
here is where my data is on page
<?
}
?>

 

Anyone see a problem there? I can't, and I ran it through my proofing program and it didn't find a problem, yet it keeps saying:

 

"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 '= 'US2000' LIMIT 1' at line 1"

 

Anyone have any idea?

 

The US2000 is a post item sent to the page from a form (i.e. http://www.website.com/class.php?icemachines=US2000 )

 

So when $icemachines is inserted it draws that data into its place, that way the page is dynamic for every item in my database by making a single form field change.

 

Whats funny is I use this SAME sql/php code on 3 other sites I made and they all work perfect. I actually just copied it from one of the other sites, changed the sql connect settings and the database names and column names. Anyone?

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.