I connect to my data base...

$dbh=mysql_connect ("localhost", "kipples_women", "xxxx") or die ('I cannot connect to 
the database because: ' . mysql_error());
mysql_select_db ("kipples_hotwomen"); 

and then I issue a query..

$query="SELECT *
              FROM women
              WHERE index = $id";
$result=mysql_query($query) or die("Query failed : " . mysql_error());

now here's where it gets funky, and where I can't figure out what is going wrong...
I now have it display the information from the row that has the field "index" and 
where index is equal to $id (the number from the url). Now, say that $id was equal to 
21... I get an error message that says.. 
" Query failed : 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 'index = 21' 
at line 3" 
Now, first of all, it isnt on line3, its like line 128 or something... second.. I 
can't see anything wrong with that syntax... My SQL server version is 4.0.18-standard 
and I can't find documentation for it.  I also tried to use LIMIT $id   Oo and it gets 
even weirder. I can get a result with LIMIT $id.... but it pulls the wrong row! if $id 
equals 24 for example, it will get the row with a value of 7 in the field for 
index....  I don't get it.. Even had a friend look at it and he said it all looked 
good.. 

I'd really appreciate any help anyone could throw at me... I'm rather new to all this!

Thanks,
Kip Gordon

Reply via email to