1
Beginners - Learning PHP / Re: Somebody please help
« on: January 11, 2012, 05:11:34 PM »
I'm all sorted now. What I needed to learn is how to pass variables through a url
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
$result = mysql_query("SELECT * FROM property") or die(mysql_error());
while ($row = mysql_fetch_array($result)){
echo $row['short_description'].''."</br>";
echo '<img src="'.$folder.''.$row['picture1'].'">'.''."</br>";
echo '<img src="'.$row['picture2'].'">';
echo '<img src="'.$row['picture1'].''."</br>";
$_SESSION['id'] = $row['id'];
}$result = mysql_query("SELECT * FROM property") or die(mysql_error());
while ($row = mysql_fetch_array($result)){
echo $row['short_description'].''."</br>";
echo '<img src="'.$folder.''.$row['picture1'].'">'.''."</br>";
echo '<img src="'.$row['picture2'].'">';
echo '<img src="'.$row['picture1'].''."</br>";
}<?php
// connect to mysql server
$link = mysql_connect('localhost', 'root', '');
if (!$link) {
die('Not connected : ' . mysql_error());
}
// connect to database server
$db_selected = mysql_select_db('images', $link);
if (!$db_selected) {
die ('Database error : ' . mysql_error());
}
//$sql = "SELECT image * FROM gallery";
$sql = "SELECT image FROM gallery";
// the result of the query
$result = mysql_query($sql) or die("Invalid query: " . mysql_error());
// Header for the image
header("Content-type: image/jpeg");
echo mysql_result($result, 0,'image');
?>