As you can see, I am pulling all the contact numbers from the table, then chosing the first number the script comes accross as the number to use. The problem is that all of the contact numbers are optional, and for some reason when the script gets to a listing without a Phone number, it uses the phone number of the previous listing. That is bad.
I have even tried resetting all of those variables mentioned above by going...
$pphone = "";
$pmob = "";
$pah = "";
$pfax = "";
at the start, so each time it goes through the loop it has all the variables equalling ""
Ummm... if anyone understands my confusing explanation, any ideas?
Last edited by Brendan Nolan; 02-12-2003 at 10:16 PM.
Okay... this is the code as it is at the moment... For the previous post I changed some variables, as they had names that did not describe them.. so don't get confused - the "namesql" and "nameresult" should of course be something like "getcontactssql" and "contactsresult".
I was afraid to show the whole code in public because I have see people call other people's code "Dog S***"
$sql = "SELECT * FROM entities ORDER BY entity_name ASC";
$result = mysql_query($sql);
Umm... this give you any insight into where I am going wrong?
The first bit contained in the while loop is just working out who's contact details we are getting... If you need I can send you a schema of the database.
I am trying to figure out why it would possibly give the code you gave me a parse error! There doesn't seem to be anything wrong with it... I tried a few variations on that - - without luck - all parse errors!