Page 1 of 1

A problem with mysql_last_id()...

Posted: Sun Oct 31, 2010 8:01 am
by Bozhimir
Parse error: syntax error, unexpected T_ECHO in C:\xampp\htdocs\public_html\test\test1.php on line 41

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<form id="form1" name="form1" method="post" action="test2.php?b=1">
  <p>
    <label>Име на теста:
      <input type="text" name="test_name" id="test_name" />
    </label>
  </p>
<p>
    <label>Категория на теста:
     <select name="test_type" >
                                        <?php   
										include ("../connect.php");
					  $result=mysql_query("SELECT * FROM tests_type "); 
					   while($row=mysql_fetch_array($result))
					   {
					   	  echo "<option value=";
						  echo "\"".$row['type_id']."\"";
						  echo ">";
						  echo $row['type_name'];
						  echo "</option>";
					   }
					  ?>
                                        </select>
    </label>
  </p>
  <p>
    <label>
      <input type="submit" name="submit" id="submit" value="Създай" />
    </label><input name="test_id" type="hidden" id="test_id" value="<?php 
include ("../connect.php");
mysql_query("SELECT TABLE tests");
$insert_id = mysql_insert_id();
$test_id = $insert_id++
echo $test_id;
?>" />
  </p>
</form>
</body>
</html>

Re: A problem with mysql_last_id()...

Posted: Sun Oct 31, 2010 7:47 pm
by califdon
You are missing the semicolon at the end of the line just before the echo statement.