Jump to content

Recommended Posts

			<table width="500" border="0" align="left" cellpadding="5">

<?php
$id=$_GET['id'];

$sql="SELECT * FROM venues WHERE id='$id'";
$result=mysql_query($sql);
while($rows=mysql_fetch_array($result)){
?>

				<tr>
                    	<td width="50%" align="left" valign="top" class="smallertitle">
                        	<? echo $rows['title']; ?>
                        </td>
                        <td width="50%" align="right" valign="top" class="condensedeventcontent">
                        	<? echo $rows['type']; ?>
                        </td>
                    </tr>
                    <tr>
                    	<td width="100%" align="left" valign="top" colspan="2">
                        	<img src="<? echo $rows['largeimage']; ?>" />
                        </td>
                    </tr>
                    <tr>
                    	<td width="100%" align="justify" valign="top" colspan="2" class="maincontent">
                        	<? echo $rows['description']; ?>
                        </td>
                    </tr>
                    <tr>
                    	<td width="100%" align="left" valign="top" class="eventaddressdate">
                        	<? echo $rows['address1'];	?>
                            <br />
                            <? echo $rows['address2']; ?>
                            <br />
                            <? echo $rows['city']; ?>
                            <br />
                            <? echo $rows['postcode']; ?>
                        </td>
                    </tr>
                    <tr>
                    <td width="100%" colspan="2" align="left" valign="bottom" class="wordsby">
                    	<a href ="<? echo $rows['webaddress']; ?>"><? echo $rows['webaddress']; ?></a>
				</td>
                    </tr>
                            
                            
<?php
}
mysql_close();
?>
</table>




		</td>
            <td>
            <table border="0" align="left" cellpadding="5">
			<?php
			$title=$_GET['title'];
			$samevenue="SELECT * FROM events WHERE venue='$title'";
			$result2=mysql_query($samevenue);
			while($rows2=mysql_fetch_array($result2)){
			?>
                <tr>
                    	<td width="50%" align="left" valign="top" class="smallertitle">
                        	<? echo $rows2; ?>
                        </td>
                </tr>
                		<?php
					}
					mysql_close();
					?>
</table>

 

 

The address it's getting info from looks like: /view_venue.php?id=12?title=Fieldgate%20Gallery

 

And the 'title' and 'venue' are always the same.

 

Help?

Link to comment
https://forums.phpfreaks.com/topic/105781-solved-whats-wrong-with-this-code/
Share on other sites

Sorry, the problem is the second part:

            <table border="0" align="left" cellpadding="5">
			<?php
			$title=$_GET['title'];
			$samevenue="SELECT * FROM events WHERE venue='$title'";
			$result2=mysql_query($samevenue);
			while($rows2=mysql_fetch_array($result2)){
			?>
                <tr>
                    	<td width="50%" align="left" valign="top" class="smallertitle">
                        	<? echo $rows2['title']; ?>
                        </td>
                </tr>
                		<?php
					}
					mysql_close();
					?>
</table>

 

Doesn't display any results.

 

I've changed it to &title= now, but still no luck...

 

 

try using some debugging

            <table border="0" align="left" cellpadding="5">
			<?php
			$title=$_GET['title'];
        echo $title;  // for debugging
			$samevenue="SELECT * FROM events WHERE venue='$title'";
			$result2=mysql_query($samevenue) or die(mysql_error());  // for debugging
			while($rows2=mysql_fetch_array($result2)){
			?>
                <tr>
                    	<td width="50%" align="left" valign="top" class="smallertitle">
                        	<? echo $rows2['title']; ?>
                        </td>
                </tr>
                		<?php
					}
					mysql_close();
					?>

 

Ray

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.