Table Stops Accepting Data

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

Table Stops Accepting Data

Postby stainystain » 20. March 2014 20:09

Hello,

New to all this - so apologies if I'm slow and frustrating...

I'm creating a form using html and php, which when run uploads information into a locally hosted xampp database.

The issue; sometimes the table simply refuses the information - it doesn't show up in the database when sent and continues to do so and I cannot get it working again. I'm given no errors when the data is submitted so it must be connecting, the info just doesn't show up.

Because of this I decided to start from the beginning again, creating a new database and table, and starting with one input (date) - it works. I add more and more fields and it continues to work... I add a couple of the dynamic name fields (see code below) and it continues to work. I get confident so add the rest of my fields - bam, it stops working. After it stops accepting data, I can't get it accepting again - even if I delete all fields so I just have "date".

Am I hitting some limit somehow?

I do apologise if the code is appalling - this isn't my day job!

Any help anybody can give me will be greatly appreciated, and will stop me tearing my hair out!

Many thanks
Simon

Code: Select all
<?
$username="xxxxxx";
$password="xxxxxx";
$database="Final";

$date=$_POST['date'];
$group_name=$_POST['group_name'];
$cruise=$_POST['cruise'];
$no_adults=$_POST['no_adults'];
$no_half=$_POST['no_half'];
$no_free=$_POST['no_free'];
$email=$_POST['email'];
$phone=$_POST['phone'];
$accommodation=$_POST['accommodation'];
$payment=$_POST['payment'];
$info=$_POST['info'];
$name_adult=$_POST['name_adult'];
$name_adult_2=$_POST['name_adult_2'];
$name_adult_3=$_POST['name_adult_3'];
$name_adult_4=$_POST['name_adult_4'];
$name_adult_5=$_POST['name_adult_5'];
$name_adult_6=$_POST['name_adult_6'];
$name_adult_7=$_POST['name_adult_7'];
$name_adult_8=$_POST['name_adult_8'];
$name_adult_9=$_POST['name_adult_9'];
$name_adult_10=$_POST['name_adult_10'];
$name_adult_11=$_POST['name_adult_11'];
$name_adult_12=$_POST['name_adult_12'];
$name_adult_13=$_POST['name_adult_13'];
$name_adult_14=$_POST['name_adult_14'];
$name_adult_15=$_POST['name_adult_15'];
$name_half=$_POST['name_half'];
$name_half_2=$_POST['name_half_2'];
$name_half_3=$_POST['name_half_3'];
$name_half_4=$_POST['name_half_4'];
$name_half_5=$_POST['name_half_5'];
$name_half_6=$_POST['name_half_6'];
$name_half_7=$_POST['name_half_7'];
$name_half_8=$_POST['name_half_8'];
$name_half_9=$_POST['name_half_9'];
$name_half_10=$_POST['name_half_10'];
$name_half_11=$_POST['name_half_11'];
$name_half_12=$_POST['name_half_12'];
$name_half_13=$_POST['name_half_13'];
$name_half_14=$_POST['name_half_14'];
$name_half_15=$_POST['name_half_15'];
$name_free=$_POST['name_free'];
$name_free_2=$_POST['name_free_2'];
$name_free_3=$_POST['name_free_3'];
$name_free_4=$_POST['name_free_4'];
$name_free_5=$_POST['name_free_5'];
$name_free_6=$_POST['name_free_6'];
$name_free_7=$_POST['name_free_7'];
$name_free_8=$_POST['name_free_8'];
$name_free_9=$_POST['name_free_9'];
$name_free_10=$_POST['name_free_10'];
$name_free_11=$_POST['name_free_11'];
$name_free_12=$_POST['name_free_12'];
$name_free_13=$_POST['name_free_13'];
$name_free_14=$_POST['name_free_14'];
$name_free_15=$_POST['name_free_15'];
$email_2=$_POST['email_2'];
$email_3=$_POST['email_3'];
$email_4=$_POST['email_4'];
$phone_2=$_POST['phone_2'];
$phone_3=$_POST['phone_3'];
$phone_4=$_POST['phone_4'];

mysql_connect('localhost',$username,$password);
@mysql_select_db($database) or die( "Unable to select database");

$query = "INSERT INTO final VALUES ('$date','$group_name','$cruise','$no_adults','$no_half','$no_free','$email','$phone','$accommodation','$payment','$info','$name_adult','$name_adult_2','$name_adult_3','$name_adult_4','$name_adult_5','$name_adult_6','$name_adult_7','$name_adult_8','$name_adult_9','$name_adult_10','$name_adult_11','$name_adult_12','$name_adult_13','$name_adult_14','$name_adult_15','$name_half','$name_half_2','$name_half_3','$name_half_4','$name_half_5','$name_half_6','$name_half_7','$name_half_8','$name_half_9','$name_half_10','$name_half_12','$name_half_13','$name_half_14','$name_half_15','$name_free','$name_free_2','$name_free_3','$name_free_4','$name_free_5','$name_free_6','$name_free_7','$name_free_8','$name_free_9','$name_free_10','$name_free_11','$name_free_12','$name_free_13','$name_free_14','$name_free_15','$email_2','$email_3','$email_4','$phone_2','$phone_3','$phone_4')";
mysql_query($query);

mysql_close();
?>


Code: Select all
[color=#BF0000][color=#BF0000]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="robots" content="noindex" />

<title>Guest Entry Form - Friendship Rose</title>

<script language="JavaScript">
function disableEnterKey(e)
{
     var key;

     if(window.event)
          key = window.event.keyCode;     //IE
     else
          key = e.which;     //firefox

     if(key == 13)
          return false;
     else
          return true;
}
</script>

<script  src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
var addDiv = $('#addinputadult');
var i = $('#addinputadult p').size() + 1;

$('#addNewadult').live('click', function() {
$('<p><input type="text" id="adult_' + i +'" value="" size="40" name="name_adult_' + i +'" value="" placeholder="Full Name (Adult)" /><a href="#adult" id="remname_adult">Remove</a> </p>').appendTo(addDiv);
i++;

return false;
});

$('#remname_adult').live('click', function() {
if( i > 2 ) {
$(this).parents('p').remove();
i--;
}
return false;
});
});

</script>

<script type="text/javascript">
$(function() {
var addDiv = $('#addinputhalf');
var i = $('#addinputhalf p').size() + 1;

$('#addNewhalf').live('click', function() {
$('<p><input type="text" id="name_half_' + i +'" value="" size="40" name="name_half_' + i +'" value="" placeholder="Full Name (Half)" /><a href="#half" id="remname_half">Remove</a> </p>').appendTo(addDiv);
i++;

return false;
});

$('#remname_half').live('click', function() {
if( i > 2 ) {
$(this).parents('p').remove();
i--;
}
return false;
});
});

</script>

<script type="text/javascript">
$(function() {
var addDiv = $('#addinputfree');
var i = $('#addinputfree p').size() + 1;

$('#addNewfree').live('click', function() {
$('<p><input type="text" id="name_free_' + i +'" value="" size="40" name="name_free_' + i +'" value="" placeholder="Full Name (Free)" /><a href="#free" id="remname_free">Remove</a> </p>').appendTo(addDiv);
i++;

return false;
});

$('#remname_free').live('click', function() {
if( i > 2 ) {
$(this).parents('p').remove();
i--;
}
return false;
});
});

</script>

<script type="text/javascript">
$(function() {
var addDiv = $('#addinputemail');
var i = $('#addinputemail p').size() + 1;

$('#addNewemail').live('click', function() {
$('<p><input type="text" id="email_' + i +'" value="" size="40" name="email_' + i +'" value="" placeholder="Contact Email" /><a href="#email" id="remNewemail">Remove</a> </p>').appendTo(addDiv);
i++;

return false;
});

$('#rememail').live('click', function() {
if( i > 2 ) {
$(this).parents('p').remove();
i--;
}
return false;
});
});

</script>

<script type="text/javascript">
$(function() {
var addDiv = $('#addinputphone');
var i = $('#addinputphone p').size() + 1;

$('#addNewphone').live('click', function() {
$('<p><input type="text" id="phone_' + i +'" value="" size="40" name="phone_' + i +'" value="" placeholder="Phone Number" /><a href="#phone" id="remNewphone">Remove</a> </p>').appendTo(addDiv);
i++;

return false;
});

$('#remphone').live('click', function() {
if( i > 2 ) {
$(this).parents('p').remove();
i--;
}
return false;
});
});

</script>

<link href="guest_form.css" rel="stylesheet" type="text/css" />
</head>[/color][/color]

<body>

      <h1 style="padding-left:30px"> Friendship Rose Guest Info </h1>
        <p style="padding-left:30px"> <b>Note:</b> The Tab Button scrolls through the form fields (mouse click can also be used), the return key creates a new line for text in the text fields </hp>
        <p>&nbsp;</p>
   <div class="form" style="float:left; padding:0 0 30px 30px">
     <form name="guest_form" action="guest_form.php" method="post" style="float:left">
     Cruise Date: dd/mm/yy (IMPORTANT)
       <br />
       <input type="date" name="date" size="30" onKeyPress="return disableEnterKey(event)" /><br /><br />
       
       Cruise
       <br />
       <input type="radio" name="cruise" value="tobagocays">Tobago Cays<br>
      <input type="radio" name="cruise" value="mustique">Mustique<br />
       <input type="radio" name="cruise" value="mayreau">Mayreau<br>
      <input type="radio" name="cruise" value="st_vincent">St Vincent<br />
       <input type="radio" name="cruise" value="bequia">Bequia<br>

       <p>&nbsp;</p>
       Group Name / Identification (Surname)
       <input type="text" id="group_name" size="40" name="group_name" value="" placeholder="Group Name" onKeyPress="return disableEnterKey(event)" />
     <p>&nbsp;</p>
       Number of Adults:<br />
       <input type="number" name="no_adults" min="1" onKeyPress="return disableEnterKey(event)" />
       <br /><br />
      Number of Kids - Half Price: (Use 0 for none)<br />
        <input type="number" name="no_half" min="0" onKeyPress="return disableEnterKey(event)" />
       <br /><br />
       Number of Kids - Free: (Use 0 for none)<br />
       <input type="number" name="no_free" min="0" onKeyPress="return disableEnterKey(event)" />
      <p>&nbsp;</p>
     
       Names of Adults:
<div id="addinputadult" style="line-height:0px">
   <p>
   <a href="#adult" id="addNewadult">Add</a><br />
    <input type="text" id="name_adult" size="40" name="name_adult" value="" placeholder="Full Name (Adult)" />
   </p>
</div>


Names of Kids - Half:
<div id="addinputhalf" style="line-height:0px">
   <p>
   <a href="#half" id="addNewhalf">Add</a><br />
    <input type="text" id="name_half" size="40" name="name_half" value="" placeholder="Full Name (Half)" />
   </p>
</div>


Names of Kids - Free:
<div id="addinputfree" style="line-height:0px">
   <p>
   <a href="#free" id="addNewfree">Add</a><br />
    <input type="text" id="name_free" size="40" name="name_free" value="" placeholder="Full Name (Free)" />
   </p>
</div>
<p>&nbsp;</p>
Contact Email/s:
<div id="addinputemail" style="line-height:0px">
   <p>
   <a href="#email" id="addNewemail">Add</a><br />
    <input type="email" id="email" size="40" name="email" value="" placeholder="Contact Email" />
   </p>
</div>

Contact Phone Number/s:
<div id="addinputphone" style="line-height:0px">
   <p>
   <a href="#phone" id="addNewphone">Add</a><br />
    <input type="number" id="phone" size="40" name="phone" value="" placeholder="Phone Number" />
   </p>
</div>
       <p>&nbsp;</p>
       Accommodation:
       <br />
       <textarea name="accommodation" rows="5" cols="60" input type="text"></textarea>
       <p>&nbsp;</p>
       Payment Status:
       <br />
       <textarea name="payment" rows="2" cols="40" input type="text"></textarea>
       <p>&nbsp;</p>
       Extra Info / Dietry Requirements:
       <br />
       <textarea name="info" rows="10" cols="60" input type="text"></textarea>
       <br />
       <p>&nbsp;</p>
       <input type="Submit" value="Submit" />
     </form>
    </div>

</body>
</html>
stainystain
 
Posts: 1
Joined: 20. March 2014 19:42
Operating System: OSX 10.9.1

Re: Table Stops Accepting Data

Postby Altrea » 21. March 2014 06:09

Hello Simon,

You are not doing any MySQL error handling so it is not surprising, that you don't get any message about whats going on there.
=> http://www.php.net/manual/en/function.mysql-error.php

best wishes,
Altrea
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8290
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64


Return to XAMPP for Mac OS X

Who is online

Users browsing this forum: No registered users and 3 guests