I have been looking over current frameworks available and I am looking to settle on CodeIgnitor.
What framework and IDE do you use?
What are the plus sides, limitations of your choice?
I have been looking over current frameworks available and I am looking to settle on CodeIgnitor.
What framework and IDE do you use?
What are the plus sides, limitations of your choice?
mysqlquery("SELECT image_id FROM image WHERE ???");
Why not :mysqlquery("SELECT image_id FROM image WHERE user_id = $_SESSION['user_id']");
RewriteEngine on
RewriteBase /
RewriteRule ^page/([0-9]+)\.php$ index.php?key=$1
Here is start of one that i use, it rewrites any URL that has index.php?key=$
and re assigns to /page/[keyid]
I have not seen url rewrite done via a DB before, but hey i am sure it will go just as well.
(remove comments)ReWriteEngine on
//Start your rewrite moduleRewriteBase /
//Sets the base, so all files read/written from [site]/
RewriteRule ^online-fair-platform/([0-9]+)$ articles.php?artid=$1
This would rewrite the linksite.something/articles.php?artid=1554
intosite.something/online-fair-platform/1554
Hope that helps
sorry long day today :)<img src='get.php?image_id=$row[lastid]'>
will only show one image.
<img src='$row[lastid]'>
this is taking the assumption you have saved the image as the ID
hwoarang69
<img src='get.php?image_id=$row[lastid]'>
i would suggest resizing the image during the upload process, as resizing in the browser will slow it down
You have changed line 9. remove the "mysql_query" and ()
`$sql = "SELECT * FROM image WHERE user_id = $user_id ORDER BY image_id DESC";'
You would need to address <img src=\"get.php?image_id=$lastid\"></img>
as it would be $row['lastid']
it $lastid is from DB
Have a look here: http://php.net/manual/en/function.mysql-fetch-assoc.php
$image seem's to be very popular variable, the below is not tested
session_start();
include("connect.php");
$user = $_SESSION['username'];
if($user)
{
$user_id = $_SESSION['user_id']; //get user_id who ever is loged in
$sql = "SELECT * FROM image WHERE user_id = $user_id ORDER BY image_id DESC";
}
echo "your gallery<br/><br/><br/>";
echo "<a href='upload.php'>upload image</a>";
echo "<a href='index.php'>home</a><br/><br/><br/>";
echo '<table>'; // Your table
echo '<tr>'; // first table row
$result = mysql_query($sql);
if (!$result) {
echo "Could not successfully run query ($sql) from DB: " . mysql_error();
exit;
}
$n = 0;
while ($row = mysql_fetch_assoc($result))
{
echo"<td> //how to do it with using get.php
<img src=\"get.php?image_id=$lastid\"></img>//print image
</td>";
$n++;
if($n == 4)
{
echo '</tr><tr>'; // Start a new row at 4 cells
$n = 0;
}
}
echo '</tr>';
echo '</table>';