Print to file from php while loop
Moderator: General Moderators
Re: Print to file from php while loop
I'm not surprised. Like I said, it looks like your query isn't returning anything. Try echoing inside the loop and see if you get anything. I suspect you won't. Or just check how many rows are returned using mysql_num_rows()
-
scoobysteve
- Forum Newbie
- Posts: 14
- Joined: Wed Jul 30, 2014 5:19 am
Re: Print to file from php while loop
I dont understand because the code I used for the echo is the same as your code see below. And the echo works. so the query must be working ??
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("cl49-listings", $con);
$result = mysql_query("SELECT * FROM tblproperties where icon1 = 'Active'");
while($row = mysql_fetch_array($result))
I placed my echo here and it works when I place your $output code it does not. ?
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("cl49-listings", $con);
$result = mysql_query("SELECT * FROM tblproperties where icon1 = 'Active'");
while($row = mysql_fetch_array($result))
I placed my echo here and it works when I place your $output code it does not. ?
Re: Print to file from php while loop
Don't assume. Check.scoobysteve wrote:so the query must be working ??
-
scoobysteve
- Forum Newbie
- Posts: 14
- Joined: Wed Jul 30, 2014 5:19 am
Re: Print to file from php while loop
all sorted now, Thank you so much guys its really appreciated. you guys rock cheers.
Steve
Steve