I’m trying to get the event id from the example below into the header URL at the end of template test.html. Can someone please show me what I’m doing wrong?
Here is my code:
<?php
header("Location: templatetest.html?.$row['event_id'].");
mysql_connect("xxxx", "xxxx", "xxxx") or die(mysql_error());
mysql_select_db("xxxx") or die(mysql_error());
$result = mysql_query("SELECT a.* FROM events a INNER JOIN (SELECT id_user, MAX(event_id) as maxID FROM events GROUP BY id_user) b ON a.id_user = b.id_user AND a.event_id = b.maxID WHERE a.id_user = '$test'")
or die(mysql_error());
// store the record of the "example" table into $row
while($row = mysql_fetch_array($result)){
};
?>
Thank You.
You can’t eat your hamburger before you order it, pay for it and receive it. Same thing in programming. Move your
headerafter the$row = mysql_fetch_array($result). Just make sure you don’t print anything in the meantime.