Run php script on windows

------=_NextPart_000_0023_01C9E8E2.8B5F2090
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

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 =3D 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


------=_NextPart_000_0023_01C9E8E2.8B5F2090--
Ash [ Di, 09 Juni 2009 05:43 ] [ ID #2004445 ]

Re: Run php script on windows

the error
PHP Fatal error: Call to undefined function mysql_connect()
says mysql extension is not enabled.

enable mysql extension in your php.ini file

for a beginner i strongly recomend
http://www.apachefriends.org/en/xampp-windows.html

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
kranthi [ Di, 09 Juni 2009 06:28 ] [ ID #2004446 ]
PHP » gmane.comp.php.database » Run php script on windows

Vorheriges Thema: pdo_pgsql connection problem
Nächstes Thema: mysqli.max_persistent clarification