georgeocrawford
Technical User
Code:
<?php
$object_name = mysql_real_escape_string($array[$i]);
$query = "INSERT INTO $table (`object_name` , `type` , `parent`, `size`) VALUES ('$object_name', '$type', '$parent', '$size')";
$result = mysql_query($query);
$parent = mysql_insert_id();
$query = "SELECT * FROM `$table` WHERE `object_id` =$parent";
$result = mysql_query($query);
while ($row = mysql_fetch_assoc($result))
{
echo "inserted name = '$row[object_name]'\n";
}
?>
When the object_name is, for example "my file with a space ", the trailing space is not entered into the database. How can I escape it?
______________________
George