USERNAME:
PASSWORD:
Save Info!
Logging in…
This topic is 1 page long.
[ Profile | Posts | Contact ]
Posted at: 5/3/09 10:50 PM
Sign-Up: 08/24/04
Posts: 464
Ok I have a query that checks for an array in the database. And then I have a while loops which displays the info from the databse. I would like the while loop to only display the rows of the database which dont have a value in the array stored in the row.
I have tried for a day or two now and havent come up with a solution could someone assist me with the proper type of loops or a better way of doing so.
Posted at: 5/3/09 11:06 PM
Sign-Up: 07/09/05
Posts: 1,443
<? $Content = ""; if (!DatabaseConnect()) $DBErrorMsg = $Content = "Unable to connect to Database"; else{ $query = "SELECT * FROM table WHERE value = ''"; $result = mysql_query($query); $num_rows = mysql_num_rows($result); if((!is_bool($result) || $result) && $num_rows) { while($row = mysql_fetch_array($result)) { $content = ""; } //while } // if is_bool else { $TickContent .= "<br />Unable to retrieve records from database.\n"; } }
That will retrieve all of the blank data from the table... The loop and the query is there, dunno if that's what you are looking for or not :)
Interested? Probably not. It's okay, I wouldn't be either. Just PM me Je parle Français, Ich spreche Deutsch! Don't worry, I speak English too!
Posted at: 5/3/09 11:33 PM
well everytime the while loop comes back around i need it to check if the next row its gonna display has that variable in the column.
Posted at: 5/4/09 01:33 AM
Sign-Up: 06/26/05
Posts: 3,284
Okay, I don't know if I'm just having trouble, but I REALLY can't understand what you need. Please be specific with exactly what you're doing. That would help immensely.
Honestly, if what I think you need is what you actually need...just use the query to filter the results. Like the last guy said.
PHP: Main WoogieNoogie.com
All times are Eastern Standard Time (GMT -5) | Current Time: 11:35 AM
<< Back