Re: [PHP] ASP to PHP language problems

2004-03-11 Thread Stuart
Richard Davey wrote: unset($type); $type = $_GET['action']; (Please note - you don't HAVE to "unset" each variable, but if you are working in a Register Globals ON environment, it's a good safety measure). I've seen a few people recommending this type of thing. Please explain how this is any safer

Re: [PHP] ASP to PHP language problems

2004-03-10 Thread Alistair Hayward
To everyone, especially Richard, Thanks a lot for the help. I have accomplished everything I needed to do with your help, and I have never used PHP before. Thanks again! alistair -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re[2]: [PHP] ASP to PHP language problems

2004-03-10 Thread Richard Davey
Hello Alistair, Thursday, March 11, 2004, 1:25:47 AM, you wrote: AH> unset($type); AH> $type = $_GET['type']; AH> $link = mysql_connect('localhost', 'user', 'password'); AH> if (!$link) { AH> echo "Couldn't make a connection!"; AH> exit; AH> } AH> $db = mysql_sele

Re: [PHP] ASP to PHP language problems

2004-03-10 Thread Rodrigo Castro
On Wednesday 10 March 2004 18:54, Raditha Dissanayake wrote: > Hi. > There is an ADO simulator for PHP (i think it's called ADODB PHP but i > can't remember the link). There is also a asp to php converter called > (can you guess? ) asp2php. http://php.weblogs.com/ And Pear::DB must work too :P h

Re: [PHP] ASP to PHP language problems

2004-03-10 Thread Alistair Hayward
Sorry, was the query! Richard Davey wrote: Hello Alistair, Wednesday, March 10, 2004, 11:26:53 PM, you wrote: AH> I get this error: mysql_num_rows(): supplied argument is not a valid AH> MySQL result resource Then your database connection failed OR the SQL query did. Check those steps over be

Re: [PHP] ASP to PHP language problems

2004-03-10 Thread Alistair Hayward
Richard Davey wrote: Hello Alistair, Wednesday, March 10, 2004, 11:26:53 PM, you wrote: AH> I get this error: mysql_num_rows(): supplied argument is not a valid AH> MySQL result resource Then your database connection failed OR the SQL query did. Check those steps over before anything else. Mayb

Re: [PHP] ASP to PHP language problems

2004-03-10 Thread Raditha Dissanayake
Hi. There is an ADO simulator for PHP (i think it's called ADODB PHP but i can't remember the link). There is also a asp to php converter called (can you guess? ) asp2php. Alistair Hayward wrote: Hi , What is the equavilant in PHP to creating a recordset in ASP using a query? This is what I d

Re[2]: [PHP] ASP to PHP language problems

2004-03-10 Thread Richard Davey
Hello Alistair, Wednesday, March 10, 2004, 11:26:53 PM, you wrote: AH> I get this error: mysql_num_rows(): supplied argument is not a valid AH> MySQL result resource Then your database connection failed OR the SQL query did. Check those steps over before anything else. Maybe post that part of y

Re: [PHP] ASP to PHP language problems

2004-03-10 Thread Alistair Hayward
Richard Davey wrote: A few ways to do this: $total_records = mysql_num_rows($result); for ($i=0; $i < $total_records; $i++) { $data = mysql_fetch_assoc($result); print_r($data); } $data will now be an array holding the first set of information. The print_r line just displays it so you can

Re: [PHP] ASP to PHP language problems

2004-03-10 Thread Alistair Hayward
Richard: Thank you so much! Richard Davey wrote: Hello Alistair, Wednesday, March 10, 2004, 10:26:03 PM, you wrote: AH> dim Type AH> Type = CStr(Request.QueryString("action")) (getting parameter from URL) unset($type); $type = $_GET['action']; (Please note - you don't HAVE to "unset" each variab

Re: [PHP] ASP to PHP language problems

2004-03-10 Thread Richard Davey
Hello Alistair, Wednesday, March 10, 2004, 10:26:03 PM, you wrote: AH> dim Type AH> Type = CStr(Request.QueryString("action")) (getting parameter from URL) unset($type); $type = $_GET['action']; (Please note - you don't HAVE to "unset" each variable, but if you are working in a Register Globals

[PHP] ASP to PHP language problems

2004-03-10 Thread Alistair Hayward
Hi , What is the equavilant in PHP to creating a recordset in ASP using a query? This is what I do in PHP: .. dim Type Type = CStr(Request.QueryString("action")) (getting parameter from URL) Dim cnn ' ADO connection Dim rst ' ADO recordset Dim strDBPath ' path to