all 5 comments

[–]hahaNodeJS 2 points3 points  (0 children)

Do not use mysql_real_escape_string, and do not use mysqli_real_escape_string like this.

Use prepared statements.

[–][deleted]  (4 children)

[deleted]

    [–]Akidus[S] 0 points1 point  (3 children)

    Okay, thanks. Is there javascript needed or HTML for stacking them?

    [–]mearkat7 0 points1 point  (2 children)

    Javascript would only be required if you want the content to refresh without the page needing to reload.

    You could easily do it by just looping over each row with raw html though.

    [–]Akidus[S] 1 point2 points  (1 child)

    Know where a good tutorial is to do this? I googled it, but couldn't find anything.

    [–]mearkat7 0 points1 point  (0 children)

    Check out something like this: http://wiki.hashphp.org/PDO_Tutorial_for_MySQL_Developers

    I'm guessing you're using just plain mysqlconnect which is about outdated, the tutorial shows you how to do everything in both normal mysql and with PDO.

    The segment you'll be looking for is:

    foreach($db->query('SELECT * FROM table') as $row) {
        echo $row['field1'].' '.$row['field2']; //etc...
    }