Hi there,
I am trying to insert some data into a database, but for some reason, it is not inserting.
Can anyone see anything wrong with my code:
<?php
$host = "***";
$username = "***";
$password = "***";
$connection = mysql_connect($host, $username, $password);
mysql_select_db("***, $connection");
mysql_query("INSERT INTO events14 (name)
VALUES ('$_POST[name]')");
?>
I have also set up an ID field which auto increments and this seems to be working, but nothing is being entered into the "name" field.
This is my form:
<form action="add_event.php" method="post">
<input type="text" name="name" id="textfield" />
<input type="submit" name="button" id="button" value="Submit" />
</form>
The file with the php code is called add_event.php, so everything is on one page.
Any ideas what I have wrong
Fatal error: Call to a member function fetchrow() on a non-object in C:xamppht
okay i have this query and everytime i add `item_id`=? to it... it gives me the error in the title...Code: $query = $db->execute("select * from items where `player_id`=?,
Passing JS to PHP
So I have the followingCode: <?phpgetdetails(?><script type="text/javascript">document.write(jsvariable)</script><?php );?>The idea is
Help with some dates
I have a list of dates in an array:$mondays = array( strtotime("October 12, 2009"), strtotime("October 19, 2009"), strtotime("October 26,
check if string contain only a-z/A-Z
Is where any way to check if string contains only a-z/A-Z, without writing an array with all possible letters and then looping it.Code: $available = array('a', 'b', 'c, 'd'); //write a-zfor
Is STL important?
I'm just starting programming and I've made it until the Standart Template Library. But the chapter seems incredibly boring, daunting and complicated, it looks so awful that I haven't yet read it so I
Warning: mysql_num_rows() supplied argument is not a valid MySQL result resource
This may be simple I just may need another pair of eyes..When i get records back the below code works just fine, when I get 0 rows back it shows the warning below. As you can see I tried to code for
Help with Contact Form
I have this Form on an html page and the associated code on page.php (below).I keep getting the "Please Fill In All Fields" message. Can you help me fix this?I'm sure I'm just missing
Trying to add functions to table
I have this list of characters and I'm trying to figure out what I have to do to put the results of these functions into the table or what not. Keep in mine that these functions are included in a file
php is not recognized as an internal or external command
Hello,I am trying to bake the code in CakePHP through my console.I have changed my Path in Environment Variables but still I am getting this error in console "php is not recognized as an internal
How to Create a Dynamic table
col1 col2 date1 date2 date3 date4..........a b v1 v2 v3 v4c d v5 v6 v7 v8e f v9 v10 v11 v12 . .