Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

code gives an error but works... =/

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

code gives an error but works... =/

Postby bezmond » Sat Apr 05, 2003 4:38 am

ok, strange error I have:
http://www.irishair.org.uk/nvas/members ... vid=200000
this script works, however, I have an error in the mysql_fetch_array() queries used in the following code:

$countrycode = $row["country"];
$query = "select * from nvas_country where code='$countrycode'";
$country = mysql_query($query);
while ($row2 = mysql_fetch_array($country))
{
$country = $row2["country"];
}
$division = $row["division"];
$query = "select * from nvas_divisions where code='$division'";
$division = mysql_query($query);
while ($row3 = mysql_fetch_array($division))
{
$division = $row3["division"];
}

I know this code works, as it basically fetches the details "United Kingdom" out of two seperate tables (as division can be different to country).
http://www.irishair.org.uk/nvas/members ... vid=200002
It also fetches a different country here.

Anyone got any suggestions?

Regards,
Andrew Berry
User avatar
bezmond
Moderator
Moderator
 
Posts: 312
Joined: Sat Apr 05, 2003 4:33 am
Location: Mansfield, UK

Postby bezmond » Sun Apr 06, 2003 12:27 am

I've managed to fix these by renaming a few variables. Thanks anyway :)

Andrew
User avatar
bezmond
Moderator
Moderator
 
Posts: 312
Joined: Sat Apr 05, 2003 4:33 am
Location: Mansfield, UK


Return to PHP coding => General

Who is online

Users browsing this forum: Google [Bot], Google Feedfetcher and 5 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.