General discussion

Locked

PHP & MySQL Query

By NetMan_OVO ·
The printf statement in below code alway returns 0 even though the SQL when run directly on the MySQL return more then 1 row.

Pls. can anyone correct me if I'am doing anything wrong.

Thanks

function query($query)
{
$connection = mysql_connect($this->hostname, $this->db_login, $this->login_pw)
$get_data = mysql_db_query($this->db, $query, $connection);

printf (count($get_data));
return $get_data;
} //-> End query

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

PHP & MySQL Query

by TimTheToolMan In reply to PHP & MySQL Query

Hi,

The mysql_db_query function is deprecated. You should use mysql_select_db() or mysql_query()
Hopefully that'll work better for you...

ref:

http://www.php.net/manual/en/function.mysql-db-query.php

(remove spaces from the above URL)
Cheers,
Tim.

Collapse -

PHP & MySQL Query

by NetMan_OVO In reply to PHP & MySQL Query

Thanks..

Take Care
Rakesh

Collapse -

PHP & MySQL Query

by NetMan_OVO In reply to PHP & MySQL Query

This question was closed by the author

Back to Web Development Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums