Run php script on windows

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux