PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
It is currently Mon Oct 16, 2017 11:01 pm

All times are UTC - 5 hours

Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Wed Jun 14, 2017 12:15 pm 
Forum Newbie

Joined: Wed Jun 14, 2017 12:07 pm
Posts: 1
I am trying to push the data from this simple html grid into mysql but I can't do it. in the beginning, I got the error that there was no index for the var impressions. I fixed that. when I use just the advertiser value I can push the data into mysql while with the second value, I can't succeed. can you explain me what I am doing wrong? here you can find my html code and as well the query i used to create the db. sorry if the questions is dumb, just a beginner


include_once 'con_ui.php';

$advertiser = $_POST["advertiser"];
$impressions = (isset($POST["impressions"])?

$sql_query = "INSERT INTO data(adv, imp) VALUES('$advertiser', '$impressions')";

// sql query for inserting data into database


<form method="post">
<table id="myTable" align='center' cellspacing=0 cellpadding=5 border=1>


<select name="advertiser" id="advertiser">
<option value="">Select advertiser</option>
<option value = "Brita ">Brita</option>
<option value = "Sammontana">Sammontana</option>


<td name= "impressions" id="impressions" >1000000</td>

<button type="submit" name="btn-save"><strong>SAVE</strong></button>
creating db here:
CREATE TABLE `shaa`.`data` (
`adv` VARCHAR( 25 ) NOT NULL ,
`imp` INT( 10 ) NOT NULL

) ENGINE = InnoDB;

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours

Who is online

Users browsing this forum: No registered users and 5 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group