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?

 

Link to comment
Share on other sites

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?

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.

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