pixeltrace Posted March 6, 2006 Share Posted March 6, 2006 guys, i need help, kindly check[a href=\"http://www.sinagtala.net/sinag3/eventsmain.php\" target=\"_blank\"]http://www.sinagtala.net/sinag3/eventsmain.php[/a]if you'll notice the Arturo Rocha Memorial Massthere is a dead image link.that's my problem.i'm not sure whats my mistake on my script but what i wanted to happen there isfrom my script i have the if-else condition wherein if the $uRow[2] ==1 the image tableshould not appear there. which is happening to the other contents.but if my $uRow[2] is not equal to 1 there should be an image therebelow is the scrpt that i used for that:=================== <? include 'db_connect.php'; $uSql = "SELECT event_image, event_title, event_description, event_imagelink FROM events WHERE event_type = 'tour' ORDER by event_date DESC"; $uResult = mysql_query($uSql, $connection); if(!$uResult){ echo 'no data found';}else{ while($uRow = mysql_fetch_row($uResult)){ ?>--------------- <? $eimages = '$uRow[3]'; if ($uRow[0] == 1) { echo ""; } else { echo '<td width="70" rowspan="2" align="center" valign="top"><table width="70" border="1" cellpadding="0" cellspacing="0" bordercolor="#666666">'; echo '<tr><td>'; echo '<a href="images/events/$eimages.jpg" target="_blank"><img src="images/events/thumbs/$eimages.gif" width="60" height="60" border="0"></a>'; echo '</td></tr></table></td>'; }?>==================hope you guys can help me with thisthanks in advance! Quote Link to comment https://forums.phpfreaks.com/topic/4228-help-in-assiging-correct-variables/ Share on other sites More sharing options...
craygo Posted March 6, 2006 Share Posted March 6, 2006 Since you started your echo with single quotes you have to come out of the echo to print up the link.[code]echo '<a href="images/events/'.$eimages.'.jpg" target="_blank"><img src="images/events/thumbs/'.$eimages.'.gif" width="60" height="60" border="0"></a>';[/code]Ray Quote Link to comment https://forums.phpfreaks.com/topic/4228-help-in-assiging-correct-variables/#findComment-14701 Share on other sites More sharing options...
pixeltrace Posted March 7, 2006 Author Share Posted March 7, 2006 Ray,Thanks but its still not working.do you think there is something wrong with the variables that i've usedthis is my sql query=========<?include 'db_connect.php';$uSql = "SELECT event_image, event_title, event_description, event_imagelink FROM events WHERE event_type = 'tour' ORDER by event_date DESC";$uResult = mysql_query($uSql, $connection);if(!$uResult){echo 'no data found';}else{while($uRow = mysql_fetch_row($uResult)){?>============and this is the script that i used for the image link with the modifications that you suggested============<? $eimages = '$uRow[3]'; if ($uRow[0] == 1) { echo ""; } else { echo '<td width="70" rowspan="2" align="center" valign="top"><table width="70" border="1" cellpadding="0" cellspacing="0" bordercolor="#666666">'; echo '<tr><td>'; echo '<a href="images/events/'.$eimages.'.jpg" target="_blank"><img src="images/events/thumbs/'.$eimages.'.gif" width="60" height="60" border="0"></a>'; echo '</td></tr></table></td>'; }?>===========do you think it has something to do with this variable?$eimages = '$uRow[3]';the data that should appear on the $eimages will come from the databasebut with the modification that you suggested, when you click on the imagelinkthis is the picture link that is showing$uRow[3].jpg===========any suggestions?thanks in advance! Quote Link to comment https://forums.phpfreaks.com/topic/4228-help-in-assiging-correct-variables/#findComment-15059 Share on other sites More sharing options...
Gaia Posted March 7, 2006 Share Posted March 7, 2006 Where are you initialzing this variable? (i'm assuming it is a variable). [b]$eimages[/b] Quote Link to comment https://forums.phpfreaks.com/topic/4228-help-in-assiging-correct-variables/#findComment-15103 Share on other sites More sharing options...
pixeltrace Posted March 8, 2006 Author Share Posted March 8, 2006 gaia,correct me on this one, i assigned $eimages for uRow['event_imagelink']since the data on the row of imagelink is the imagename of the image on the script that i made here echo '<a href="images/events/'.$eimages.'.jpg" target="_blank"><img src="images/events/thumbs/'.$eimages.'.gif" width="60" height="60" border="0"></a>';is this correct?if not can do you have any suggestions on this. because honestly i am still getting confused with assigning variables.======== this is my query <? include 'db_connect.php'; $uSql = "SELECT event_image, event_title, event_description, event_imagelink FROM events WHERE event_type = 'tours' ORDER by event_date DESC"; $uResult = mysql_query($uSql, $connection); if(!$uResult){ echo 'no data found';}else{ while($uRow = mysql_fetch_row($uResult)){ ?>======== and this is the script that i used for the imagelink <? $eimages = '$uRow[3]'; if ($uRow[0] == 1) { echo ""; } else { echo '<td width="70" rowspan="2" align="center" valign="top"><table width="70" border="1" cellpadding="0" cellspacing="0" bordercolor="#666666">'; echo '<tr><td>'; echo '<a href="images/events/'.$eimages.'.jpg" target="_blank"><img src="images/events/thumbs/'.$eimages.'.gif" width="60" height="60" border="0"></a>'; echo '</td></tr></table></td>'; }?> Quote Link to comment https://forums.phpfreaks.com/topic/4228-help-in-assiging-correct-variables/#findComment-15312 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.