PostCodes
- ID- auto
- City char 50
- PostCode char 20
Addresses
- Name
- Age
- City char 50
- PostCode char 20
This is the call I make .
ConnectToMySQL(); // Display Error if not connected
UseDatabase("Statistics"); // Display Error if not used
if(mysql_query(&mysql,"insert into PostCodes select 0,City,PostCode
from Addresses where City !='CAL'")!=0)
Show_error();
And I get this error.
Access denied for user: 'jahan@localhost' to database 'Statistics'
Thing that I checked.
-> Connected to MySQL - Yes
-> Can insert to PostCodes , if I drop the select part
-> Tried the <> operator
-> Works very fine in command prompt ( copy /paste, exactly )
Q. Is it built feature not to support subquery in mysql_query ?
Q. Any expert sees any problem with the query above ?
Thank you very much.