[PHP-DB] getting mysql_fetch_row into array

2002-09-23 Thread LSC Exhibits Department

Going through brain-lock here. From this query Select count(deptid) from
maintenance group by deptid ,I get 11 rows. What I need to do is get an
array like $a=array(315,11,43,67,415,32,25,63,93,46,76) from this query, so
that 
$a[0]=315
$a[1]=11
$a[2]=43 
and so on. The best I can get is ;
$a[0][0]=315
$a[0][1]=11
$a[0][2]=43 and so on. Does anyone have any ideas???

John Coder
  

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] mysql_num_rows

2002-09-19 Thread LSC Exhibits Department

I'm getting a strange error message from calling this function 

It spits out Unknown column 'Resource' in 'field List'
This is my query:

SELECT dept.name, count(maintenance.deptid)/$total AS percentage FROM
maintenance
JOIN dept WHERE maintenance.deptid=dept.deptid GROUP BY dept.name

This query runs fine in console I just can't get mysql_num_rows to return a
value.

This is running mysql 4.0.3 and php 4.2.3

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




FW: [PHP-DB] mysql_num_rows

2002-09-19 Thread LSC Exhibits Department






--
From:  1LT John W. Holmes [SMTP:[EMAIL PROTECTED]]
mailto:[SMTP:[EMAIL PROTECTED]] 
Sent:  Thursday, September 19, 2002 2:56 PM
To:  LSC Exhibits Department; [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] 
Subject:  Re: [PHP-DB] mysql_num_rows

What's the value of $total? Probably Resource, meaning something
else
before you query isn't going as you expect it to.

Yep that was what is was I put single quotation marks around $total
and solved that prolem
Thanks

John Coder

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php