NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
mysql_init, mysql_real_connect, mysql_real_query functions


Joined: 10 Jan 2008
Posts: 5
Location: Santa Cruz, CA
Reply with quote
Hi dmitri...

Thank you for working so diligently to make PHPed such a great tool. I purchased in feb, along with a book "learn php in 10 minutes" Shocked and 4 1/2 months later have a good website up and running well. 4grabs.org is a cool replacement for craigslist in your neighborhood.

I recently decided to change some of my code using mysql to use mysql_real_query and recoded my class. Unfortunately these function calls are undefined, and I can't figure out why.

mysql_connect(), mysql_query(), mysql_error ()and mysql_close() are defined somewhere because they are represented as blue type and work when I run the scripts.

when I changed them to mysql_init(), mysql_real_connect(), and mysql_real_query() they remain in black type and when I run the script it chokes at a fatal error: Call to undefined function mysql_init().

I am using php5.2.5 exclusively and phpinfo shows mysql version 5.0.51 for both mysql and mysqli.

I don't understand how some mysql calls are defined and some are not. Where are these functions defined? perhaps a lib file that is missing or not linked properly. And what is totally weird is that mysql_real_escape_string(stripslashes($str)) works just fine.

Any ideas how I can fix my problem?

Thanks in advance...steve
View user's profileFind all posts by steverussSend private message
Veteran

Joined: 06 Jun 2007
Posts: 289
Location: Vancouver, Canada
Reply with quote
I don't think mysql_init(), mysql_real_connect(), and mysql_real_query() are supported by PHP. Well, at least I do not see any references to them in the PHP manual. I do not think this is a PhpED problem Wink

_________________
Smile
View user's profileFind all posts by annoSend private messageVisit poster's website
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
Right. Those functions are defined in mysql client API available in C language, but not in PHP. What you have in PHP is defined in php mysql extension, a library documented in PHP manual.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
mysql_init, mysql_real_connect, mysql_real_query functions
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic