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
lso be returned as an array, object, or row
//
see mysql_fetch_array, mysql_fetch_object, and mysql_fetch_row respectively
{
Here is a loop
}
"Alistair Hayward" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hi ,
What is the equavilant in PHP to
ave not found what I need.
Chris W. Parker wrote:
Alistair Hayward <mailto:[EMAIL PROTECTED]>
on Wednesday, March 10, 2004 2:46 PM said:
This is what I get when I try to create the recordset
Notice: Use of undefined constant DBlink - assumed 'DBlink' in
D:\Develop
if (!$db) {
echo "Couldn't select database!";
exit;
}
$type = $_GET['type'];
$sql = "SELECT * FROM tbCategory WHERE Type =$type order by style";
$resultID = mysql_query($sql, DB);
?>
Chris W. Parker wrot
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
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
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
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
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
Hi,
I am an ASP user, now learning PHP.
When adding a record in ASP, I do this:
Recordset.AddNew
Field1 = whatever
RecordSet.Update
How is this done in PHP?
I have built a recordset using a query, and have all the information
needed to go into the different fields, but how do I 'Edit' or 'AddN
10 matches
Mail list logo