Note that there are some explanatory texts on larger screens.

plurals
  1. POInserting a Blank Record When Inserting into data into phpmyadmin
    text
    copied!<p>i am relatively new to the php coding life and i need some help. when i am inserting data into my phpmyadmin account it inserts the record i would like but it also inserts just a blank record? Suggestions? also new to this site if theres any gaps in coding they arent actually there.</p> <pre><code>&lt;?php $host="xxxxx"; $username="xxxxx"; $password="xxxxx"; $db_name="xxxxx"; $tbl_name="LimitlessInventory"; mysql_connect("$host", "$username", "$password")or die("Cannot Connect"); mysql_select_db("$db_name")or die("Cannot Select Database"); $year=$_POST['year']; $make=$_POST['make']; $model=$_POST['model']; $price=$_POST['price']; $description=$_POST['description']; $buyme=$_POST['buyme']; echo "$year"; echo "$make"; echo "$model"; echo "$price"; echo "$description"; echo "$buyme"; $sql="INSERT INTO $tbl_name(year, make, model, price, description, buyme)VALUES('$year', '$make', '$model', '$price', '$description', '$buyme')"; $result=mysql_query($sql); mysql_close(); ?&gt; &lt;html&gt; &lt;body&gt; &lt;title&gt;Limitless Auto&lt;/title&gt; &lt;form action="LimitlessInsert2.php" method="POST"&gt; Year: &lt;input type="text" size="4" maxlength="4" name="year" value="Ex.2012"&gt;&lt;br /&gt; Make: &lt;input type="text" size="12" maxlength="12" name="make" value="Ex.Chevrolet"&gt;&lt;br /&gt; Model: &lt;input type="text" size="12" maxlength="12" name="model" value="Ex.Corvette"&gt;&lt;br /&gt; Price: &lt;input type="text" size="9" maxlength="9" name="price" value="Ex.$15,999.00"&gt;&lt;br /&gt; Description: &lt;input type="text" size="75" maxlength="255" name="description" value="Ex.2000 Miles 5.7L V8 Red"&gt;&lt;br /&gt; Link: &lt;input type="text" size="255" maxlength="255" name="buyme" value="&lt;a href=http://solemnprophecy.com/DAT201/LimitlessBuyNow.php&gt;Buy_ME!&lt;/a&gt;"&gt;&lt;br /&gt; &lt;input type="submit" name="submit"&gt; &lt;/form&gt; &lt;a href="http://solemnprophecy.com/DAT201/LimitlessInventory.php"&gt;Inventory Page&lt;/a&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload