PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
RobertGonzalez
Site Administrator
Posts: 14293 Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA
Post
by RobertGonzalez » Thu Nov 09, 2006 5:16 pm
add this to the beginning of your script:
Code: Select all
<?php
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);
?>
This will show not critical errors in the code. If the page is still blank then it is a syntax issue (unclosed bracket, missing semi-colon, etc).
JimiH
Forum Commoner
Posts: 92 Joined: Thu Jun 15, 2006 6:10 am
Post
by JimiH » Thu Nov 09, 2006 5:31 pm
Yes must be something missing the page is still blank!
I recreated the basic problem at home so the tables and fields are different until I get back to work.
Code: Select all
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);
echo $TAB1FIELD3 ;
echo"<select name=\"TAB1FIELD3\">";
while($row=mysql_fetch_assoc($my_query))
{
$selected = ( $TAB1FIELD3 == $row['TAB2FIELD2'] ) ? ' selected="selected"' : '';
echo '<option value="'.$row['TAB2FIELD2'].'"' . $selected .
//echo "<option value=\"".$row['TAB2FIELD2']."\">".$row['TAB2FIELD2']."</option>";
}
I'll have a look and see whats missing
Thanks
Geoff
RobertGonzalez
Site Administrator
Posts: 14293 Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA
Post
by RobertGonzalez » Thu Nov 09, 2006 5:57 pm
You're missing a semicolon
Code: Select all
<?php
while($row=mysql_fetch_assoc($my_query))
{
$selected = ( $TAB1FIELD3 == $row['TAB2FIELD2'] ) ? ' selected="selected"' : '';
// ON THE BELOW LINE ADD A SEMICOLON
echo '<option value="'.$row['TAB2FIELD2'].'"' . $selected .
}
?>
JimiH
Forum Commoner
Posts: 92 Joined: Thu Jun 15, 2006 6:10 am
Post
by JimiH » Fri Nov 10, 2006 5:35 am
Hi
This is strange I pasted your original code at work & it worked first time
I must have different versions of PHP or something.
anyway it works, thank you very much for your help.
Geoff
RobertGonzalez
Site Administrator
Posts: 14293 Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA
Post
by RobertGonzalez » Fri Nov 10, 2006 8:32 am
Your welcome. Post back if you have any other troubles.