PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I'm trying to use the MySqli class to add to my MySql DB but for some reason it doesn't work, but if I type the same line in the MySQL administrator panel everything works!!!
I had not used MySqli. But below can be the reason the problem u r facing !!
When u will typing the same line in MySQL u r getting the things, because u will be
rewriting the insert query which is same in MySQL & MySqli.
But I think the problem will be the object that u r making for connection - [new mysqli]
Due to this connection is established to mysqli and not to mysql.
Your query should work either way. Did you try running the SQL directly through the mysql command line or phpMyAdmin? what is the exact error message you get?
No that's what I'm saying... If I execute that query in MySql Command line it works no problem, If I runit using the MySqli->query() thing I always get 0 rows inserted.
Make sure your error reporting is cranked up to E_ALL and display errors is on (which means you should be doing this locally and not on your production server).