[SOLVED]$end problem
Posted: Mon Jan 19, 2004 8:42 am
I got this unexpected $end problem in the closing tags ?> first i thought i might be something with apache 2.0.4.8 with being still experimental with php4 ( v4.3.4) so i installed version 1.3.29 however the ?> errror keeps on coming, now i know its not the closing tags however i can not seem to find the problem. ( 2 scripts )
__________________________________________
second code with same error
both have error
Parse error: parse error, unexpected $end ($line :> )
Now where did i go wrong ???
Code: Select all
<?php
$dbase ='home';
$tablename ='pongo';
$connect= mysql_connect('localhost', 'root')
or die("Cant connect: " .mysql_error());
$result=mysql_select_db($dbase)
or die("Cant execute query: " .mysql_error());
$query = 'CREATE TABLE if not exist " . $tablename . "(Empresa varchar(20) Not Null, Codigo INT(10), From varchar(20) Not Null, To varchar(20) Not Null, Information varchar(20) Not Null, Comment varchar(20) Not Null Codigo_Env PRIMARY KEY)";
$result = mysql_query($query);
if (!$result)
{
die ( "Execute error: " .mysql_error());
}
else
{
echo $tablename . " Todo bien, comienza.\n";
}
$query ='INSERT INTO pongo VALUES ('" . $s1 ."', '" . $2 ."','" . $3 . "','" . $4 . "','" . $5 . "','" . $6 . "','" . $7 . "','" . $8 . "','" $9 . "')';
if (!$result = mysql_query($query);
die(mysql_error());
}
?>second code with same error
Code: Select all
<?
function pc_print_form($errors) {
$fields = array(Empresa => 'Empresa',
Informacion => 'Informacion',
Desde => 'Desde',
Envio => 'Envio');
if (count($errors)) {
echo 'Por favor revisar to entradas';
}
echo '<table';
//printing errors
foreach ($fields as $field => $fieldname) {
//open row
echo '<tr><td>';
// printing error
if (!empty($errors[$field])) {
echo $errors[$field];
}else {
echo ' '; // making sure the tables are printed correct
}
echo '</td></tr>';
// printing values
$value = isset($_REQUEST[$field]) ?
htmlentities($_REQUEST[$field]) : '';
echo '$fieldname: ';
echo '<input type="text" name="$field" value="$value">';
echo '</td></tr>';
}
echo '</table>';
?>Parse error: parse error, unexpected $end ($line :> )
Now where did i go wrong ???