I'm having some trouble echoing a value to a file that is being pulled
from a MySQL database. I've included my code below I'm sure it's something
really simple but I'm not seeing it. $row['users.name'] and
$row['users.company'] echo nothing while $row['cnt'] echoes it's expected
values. If anyone can tell me what I'm doing wrong I'd appreciate it.
Thanks,
Ed
$ap = fopen("$ad_path/AdCount$issue.txt", "w");
mysql_connect ($local_host, $local_user, $local_pass);
mysql_select_db ($local_db);
$result = mysql_query ("SELECT *, COUNT(*) as cnt FROM users, listings
WHERE listings.user_id = users.id AND listings.active = '1' GROUP BY
users.company, users.name");
if ($row = mysql_fetch_array($result)) {
do {
fputs($ap, $row['users.name']);
fputs($ap, $sp);
fputs($ap, $sp);
fputs($ap, $row['users.company']);
fputs($ap, $sp);
fputs($ap, $sp);
fputs($ap, $row['cnt']);
fputs($ap, $nl);
}
while($row = mysql_fetch_array($result));
mysql_close(); }
fclose($ap);
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php