samedi 2 juillet 2016

Select Statement using php variable

Got a problem trying to get this SQL query to work in my php. id is in the URL and then i want to use it as a variable $id with the select statement.. struggling to see what i am doing wrong

        require ("scripts/connect.php");

        if (isset($_GET['id'])) {
               $id = $_GET['id'];

        $get = mysql_query("SELECT * FROM media WHERE id = '" . $id . "'"));




Aucun commentaire:

Enregistrer un commentaire