Name: Anonymous 2011-06-27 14:58
Ohai, this is an actual programming question. Basic php shit.
Need to exclude whitespaces from mysql input. Basically the field shouldn't have spaces in it. When user inserts space accidentally, php needs to eliminate it, whether searching or updating the field.
<tr><td>Model# </td><td><input type="text" name="model" size="" /></td></tr>
<?php
$id = $_POST[''];
$model = $_POST['model'];
$query= "INSERT INTO product_specs (ID, model)
VALUES ('NULL', '".$model."')";
?>
Also need to exclude whitespaces from mysql query.
<form onsubmit="return false;">
Model: <input onkeyup="getSpecs(this.value)" />
<input type="submit" value="Submit"/>
<?php
$model=$_GET["model"];
$result = mysql_query("select * from product_specs where model ='$model'");
if ($row = mysql_fetch_object($result)) {
echo 'Model# '. $row->model . '<br />';
}
?>
Need to exclude whitespaces from mysql input. Basically the field shouldn't have spaces in it. When user inserts space accidentally, php needs to eliminate it, whether searching or updating the field.
<tr><td>Model# </td><td><input type="text" name="model" size="" /></td></tr>
<?php
$id = $_POST[''];
$model = $_POST['model'];
$query= "INSERT INTO product_specs (ID, model)
VALUES ('NULL', '".$model."')";
?>
Also need to exclude whitespaces from mysql query.
<form onsubmit="return false;">
Model: <input onkeyup="getSpecs(this.value)" />
<input type="submit" value="Submit"/>
<?php
$model=$_GET["model"];
$result = mysql_query("select * from product_specs where model ='$model'");
if ($row = mysql_fetch_object($result)) {
echo 'Model# '. $row->model . '<br />';
}
?>