Jump to content


Photo

help in assiging correct variables


  • Please log in to reply
4 replies to this topic

#1 pixeltrace

pixeltrace
  • Members
  • PipPipPip
  • Advanced Member
  • 577 posts

Posted 06 March 2006 - 06:00 PM

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 Mass
there 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 is
from my script i have the if-else condition wherein if the $uRow[2] ==1 the image table
should 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 there
below 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 this
thanks in advance!





#2 craygo

craygo
  • Staff Alumni
  • Advanced Member
  • 1,973 posts
  • LocationRhode Island

Posted 06 March 2006 - 06:39 PM

Since you started your echo with single quotes you have to come out of the echo to print up the link.

echo '<a href="images/events/'.$eimages.'.jpg" target="_blank"><img src="images/events/thumbs/'.$eimages.'.gif" width="60" height="60" border="0"></a>';

Ray


#3 pixeltrace

pixeltrace
  • Members
  • PipPipPip
  • Advanced Member
  • 577 posts

Posted 07 March 2006 - 02:04 PM

Ray,
Thanks but its still not working.

do you think there is something wrong with the variables that i've used
this 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 database
but with the modification that you suggested, when you click on the imagelink
this is the picture link that is showing
$uRow[3].jpg

===========
any suggestions?
thanks in advance!


#4 Gaia

Gaia
  • Members
  • PipPipPip
  • Advanced Member
  • 95 posts
  • LocationCanada

Posted 07 March 2006 - 04:45 PM

Where are you initialzing this variable? (i'm assuming it is a variable).

$eimages

#5 pixeltrace

pixeltrace
  • Members
  • PipPipPip
  • Advanced Member
  • 577 posts

Posted 08 March 2006 - 05:59 AM

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>';
}?>







0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users