Squidge 101 Newbie Poster

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?

Squidge 101 Newbie Poster

mysqlquery("SELECT image_id FROM image WHERE ???");

Why not :
mysqlquery("SELECT image_id FROM image WHERE user_id = $_SESSION['user_id']");

Squidge 101 Newbie Poster

Try this site:

Click Here

Found this

Squidge 101 Newbie Poster

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 module
RewriteBase / //Sets the base, so all files read/written from [site]/

RewriteRule ^online-fair-platform/([0-9]+)$ articles.php?artid=$1

This would rewrite the link
site.something/articles.php?artid=1554
into
site.something/online-fair-platform/1554

Hope that helps

Squidge 101 Newbie Poster

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 commented: it almost worked +0
Squidge 101 Newbie Poster

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

hwoarang69 commented: ty +0
Squidge 101 Newbie Poster

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

hwoarang69 commented: thanks +2
Squidge 101 Newbie Poster

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>';
hwoarang69 commented: thanks alot +0
Squidge 101 Newbie Poster

Looks like the additional "clearfloat" try removing the class from line 236

Although reading the comment it should be inserted to line 230

.kaine commented: thanks +0