Welcome Guest. Please Login or Register  


You are here: Index > AMPPS > Bugs > Topic : problem with mysqli access to mysql



Threaded Mode | Print  

 problem with mysqli access to mysql, not possible to use DELETE (6 Replies, Read 15068 times)
mvvv
Group: Member
Post Group: Newbie
Posts: 5
Status:
I can open a mysql DB table from php anbd run INSERT and SELECT queries
on it with mysqli but somehow the damned library returns a syntax error on a DELETE query where as far as I can tell there is none. Very strange....

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 'DETELE FROM ww1vars WHERE varname='lastName'' at line 1

Obviously I tried to reformat the query, ran even without the WHERE clause, nothing works. When I run this from the phpmyadmin or from the mysql prompt there is no problem.  I also checked carefully if the user has DELETE permissions: it should have all permissions. This is also confirmed by logging into mysql as the user and doing the DELETE query succesfully. I am getting very frustrated,.
Any suggestion would be very welcome.
IP: --   

problem with mysqli access to mysql
mvvv
Group: Member
Post Group: Newbie
Posts: 5
Status:
Note: running on windows7 & SSD  :squi:
IP: --   

problem with mysqli access to mysql
tidus
Group: Member
Post Group: Super Member
Posts: 1121
Status:
Hi,

Try this :

PHP Code

 $conn mysql_connect('localhost''root''PASSWORD');
$result mysql_query('DELETE FROM `ww1vars` WHERE `varname`= \'lastName\''$conn);

if(
$result){
 echo 
'Done';
}else{
 echo 
mysql_error($conn);




Note : if lastName is variable replace it with '.$varname.'

Edited by tidus : October 4, 2012, 12:35 pm

-----------------------
Follow AMPPS on,
Twitter : https://twitter.com/AMPPS_Stack
Facebook :  http://www.facebook.com/softaculousampps
Google+ : https://plus.google.com/+AmppsStack
IP: --   

problem with mysqli access to mysql
mvvv
Group: Member
Post Group: Newbie
Posts: 5
Status:
The probem is in the spelling of DELETE: it is spelt as DETELE
IP: --   

problem with mysqli access to mysql
tidus
Group: Member
Post Group: Super Member
Posts: 1121
Status:
Hi,

Yes. Corrected. :)

Was it working after writing DELETE ?

-----------------------
Follow AMPPS on,
Twitter : https://twitter.com/AMPPS_Stack
Facebook :  http://www.facebook.com/softaculousampps
Google+ : https://plus.google.com/+AmppsStack
IP: --   

problem with mysqli access to mysql
mvvv
Group: Member
Post Group: Newbie
Posts: 5
Status:
yes, working now pffff what a wasted time
IP: --   

problem with mysqli access to mysql
mvvv
Group: Member
Post Group: Newbie
Posts: 5
Status:
:cry: yes, working now pffff what a wasted time
IP: --   

« Previous    Next »

Threaded Mode | Print  



Jump To :


Users viewing this topic
1 guests, 0 users.


All times are GMT. The time now is April 23, 2024, 10:25 pm.

  Powered By AEF 1.0.8 © 2007-2008 Electron Inc.Queries: 11  |  Page Created In:0.044