Home  |  Linux  | Mysql  | PHP  | XML
From:Ash Date:Tue Jun  9 03:43:25 2009
Subject:Run php script on windows
HI Team,

I am new to PHP. I want to run below PHP script. I know mysql credentials.
I have installed PHP 5.x on my windos mahcine, now can any tell me how to run this script.
I ran
C:\Program Files\PHP>php temp.php
PHP Fatal error: Call to undefined function mysql_connect() in C:\Program Files
\PHP\temp.php on line 2


<?php
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
mysql_select_db('mydb');

/* this should return the correct numbers of deleted records */
mysql_query('DELETE FROM mytable WHERE id < 10');
printf("Records deleted: %d\n", mysql_affected_rows());

/* with a where clause that is never true, it should return 0 */
mysql_query('DELETE FROM mytable WHERE 0');
printf("Records deleted: %d\n", mysql_affected_rows());
?>


Regards,
Ashvini


Navigate in group php.db at sever news.php.net
Previous Next


Your recent visits
Re: [PHP-DB] postgres - pg_query works; pg_query_params doesn't
Re: [PHP-DB] pdo_pgsql connection problem
pdo_pgsql connection problem
Re: [PHP-DB] 64-bit Linux -- Fatal ... undefined function mysql_connect()



  
© No Copyright
You are free to use Anything, but please consult your advocate before doing so as this website
also list content from other sources which may be copyrighted.
Site Maintained by Zareef Ahmed
Powered By PHP Consultants