Jessica
Staff Alumni-
Posts
8,968 -
Joined
-
Last visited
-
Days Won
41
Everything posted by Jessica
-
Who would bother to look past page 1 of a result set with 10k rows in random order, without applying a logical order?
-
IF(t1.date_expires >= NOW(), IF(t2.date_expires >= NOW(), true, false), false) should work.
-
$arr2[] = explode(",",$_POST['hidden-tags']); Remove the [] and your arrays will have the same number of dimensions.
-
You know how you have login.login_id to specify the table.column? DO that for the other column.
-
A number cannot be both 3 AND 4. It could be ..... 3 OR 4.... If you just want the entire count remove the group by.
-
A user level can't be both equal to 3 and equal to 4. There is no such number. Furthermore, if you want the output you said in your first post, you don't want the number of rows returned, you want the actual rows.
-
You'll need to use COUNT() and GROUP BY in your query. Check out the MySQL documentation and give it a shot.
-
Every single example on the page shows how to do that: http://php.net/mysql_fetch_array
-
Set them in the php.ini file.
-
I told you where your error is, did you fix it?
-
Edit your php.ini to set display_errors to 1 and error_reporting to -1. It's a lot easier to just read them on the screen (when in development environment) than a log file.
-
A query should be: SELECT fields FROM table. You use quotes around strings, and % is a wildcard for searching. However if that exact query works in command line, your table is named literally '%stocktable%' Do SHOW TABLES; and see what it says.
-
Yes. It's an error. error_reporting
-
You really should rename your table so it's just stocktable. Or even better: stock. And WHERE 1 is superfluous.
-
Make sure you have error reporting turned on ,then capture MySQL errors. A blank page means you have a fatal PHP error, which you should be able to see by enabling error_reporting set to E_ALL. If this is your actual code, the problem is the line after the query(). You're missing something vital.
-
There's tons of examples in the manual. Post your code and we can help.
-
Need help preforming a mysql_fetch_array with OOP
Jessica replied to eldan88's topic in PHP Coding Help
After rereading your post its possible your confirm_query function does that, requinix found the problem in your posted code. But ensure your code does capture SQL errorsz -
Need help preforming a mysql_fetch_array with OOP
Jessica replied to eldan88's topic in PHP Coding Help
You need to remove the = too. -
Need help preforming a mysql_fetch_array with OOP
Jessica replied to eldan88's topic in PHP Coding Help
You need to check for SQL errors after running the query. See the link in my signature. -
You need to update the HTML headers on the page to let the browser know its a new version.
-
Just thinking out loud, but if all he wants is the first and last, wouldn't it be better to just do two queries, one ASC and one DESC? If OP is going to use the results at all that's different, but hypothetically if he only wants first and last?