| 7:29 pm on Sep 1, 2004 (gmt 0)|
Welcome to WebmasterWorld StevieMac,
my wild guess is that the query isn't working try this to help debug
$query = mysql_query($sql) or die(mysql_error());
| 1:45 am on Sep 2, 2004 (gmt 0)|
Thanks for responding so quickly. I made the change like you suggested and I can't believe that I made that simple of a mistake. However, all I still get is
select * from wifi_ap where SSID ='
On the page. I get that because I put an echo statment in there to also try and debug.
| 1:50 am on Sep 2, 2004 (gmt 0)|
with what you have above you are missing a ' between SSID = '" . $_POST['
| 3:58 am on Sep 2, 2004 (gmt 0)|
That was it.... but now it returns every record in that database. Not the one's that I'm searching for.....
| 10:50 am on Sep 2, 2004 (gmt 0)|
Well I am not to sure on how case snsitive this stuff is since I am lazy and use lower case. In your form you have ssid in your $_POST you have SSID... it is possible that the difference there is causing you to return all records instead of just the one you want.
| 2:36 pm on Sep 2, 2004 (gmt 0)|
A perfect example of why error reporting should always be set to E_ALL for development. You would get a "undefined index" warning if you turned up error reporting (yes, variables, constants and array indices are case sensitive in PHP, even under Windows).
So $_POST['SSID'] should be undefined, so PHP will treat is as an empty string, but that shouldn't return all records unless the SSID column is in fact empty in the data.
Echo out your $SQL var to see what query you're actually sending to the DB server.
To change error reporting, search for error_reporting in your php.ini and change it to E_ALL on your development computer. It will make life much easier in the long run.
| 9:58 pm on Sep 2, 2004 (gmt 0)|
Understandable about the E_All. I do have that on, it it doesn't say anything. Also the echo of the SQL shows:
select * from wifi_ap where ssid =''
Here is my two lines of code.
$sql = "select * from wifi_ap where ssid ='" . $_POST['SSID'] . "'";
| 10:02 pm on Sep 2, 2004 (gmt 0)|
I think that I figured it out. Thanks to you all....
I had the post ssid in CAPS. It was lowercase in the form.
$sql = "select * from wifi_ap where SSID ='" . $_POST['ssid'] . "'";
| 10:54 pm on Sep 2, 2004 (gmt 0)|
That's really curious. Normally with E_ALL you should have gotten a notice or warning for undefined index. Are you sure you aren't suppressing errors or notices?