query problem
Posted: Wed Mar 16, 2005 7:24 am
Code: Select all
<?php
session_start();
require "connect.php";
$title = $_GET['title'];
$startdate = $_GET['startdate'];
$query = "insert into project values (0,'".$title."','".$startdate."')";
$result = mysql_query($query, $connection)
or die(mysql_error());
$projid = mysql_insert_id($connection);
foreach($_SESSION['group'] as $key => $person){
$query = "insert into member values(".$_SESSION['group'][$key]['pid'].",".$projid.",'".$_SESSION['group'][$key]['job']."')";
$result = mysql_query($query, $connection)
or die(mysql_error());
}
unset($_SESSION['group']);
header("Location:viewgroups.php");
exit();
?>There is a problem with the > in the for loop which automatically matches the <?php tag and does not allow any of the code following it to be used. How can i get round this problem?
feyd | Please use
Code: Select all
andCode: Select all
tags where approriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]