473,770 Members | 2,153 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Column count doesn't match value count at row 1

4 New Member
i have this table in my database:
CREATE TABLE FILM(
F_ID INT(5) NOT NULL AUTO_INCREMENT,
F_TITLE VARCHAR(40) NOT NULL,
DIRECTOR_FNAME VARCHAR(20) NOT NULL,
DIRECTOR_LNAME VARCHAR(20) NOT NULL,
TYPE VARCHAR(30) NOT NULL,
DURATION TIME ,
YEAR_RELEASE YEAR NOT NULL,
DESCRIPTION TEXT,
RENT_TIME SMALLINT(2),
PRICE VARCHAR(4) NOT NULL ,
F_EMPLOYEE_ID INT(3),
PRIMARY KEY(F_ID),
UNIQUE(F_TITLE) ,
CONSTRAINT CRS
FOREIGN KEY (F_EMPLOYEE_ID) REFERENCES EMPLOYEE(E_ID)
ON DELETE CASCADE ON UPDATE CASCADE
);

i have 2 files:
//form_reg_film.h tm
<html><center>< head><title>ΕΓΓ ΡΑΦΗ ΤΑΙΝΙΑΣ</title></head>
<body bgcolor="#6699F F">
<h3> ΕΓΓΡΑΦΗ ΤΑΙΝΙΑΣ </h3>
<form name=reg_film action=reg_film .php method="POST">< table border=0>
<tr><td align = left>TΙΤΛΟΣ:</td><td align=left><inp ut type=text size=40 name=F_TITLE MAXLENGTH=40 AUTOCOMPLETE=ON ></td></tr>
<tr><td align = left>ΟΝΟΜΑ ΣΚΗΝΟΘΕΤΗ:</td>
<td align=left><inp ut type=text size=20 name=DIRECTOR_F NAME MAXLENGTH=20 AUTOCOMPLETE=ON ></td></tr>
<tr><td align = left>ΕΠΩΝΥΜΟ ΣΚΗΝΟΘΕΤΗ:</td>
<td align=left><inp ut type=text size=20 name=DIRECTOR_L NAME MAXLENGTH=20 AUTOCOMPLETE=ON ></td></tr>
<tr><td align = left>ΚΑΤΗΓΟΡΙΑ: </td>
<td lign=left><sele ct name=TYPE size="1">
<option selected value="Category ">All categories</option>
<option value="Action & Adventure" >Action & Adventure</option>
<option value="Comedy" >Comedy</option>
<option value="Cult" >Cult</option></select></td></tr>
<tr><td align = left>ΔΙΑΡΚΕΙΑ:</td><td align=left>
<select name=hour size="1" >
<option selected value="hour">ho ur</option><option value="00">00</option>
<option value="01">01</option></select>
: <select name=minute size="1">
<option selected value="minute"> minute</option>
<option value="00">00</option><option value="01">01</option>
<option value="02">02</option><option value="03">03</option>
<option value="04">04</option><option value="05">05</option>
<option value="06">06</option><option value="07">07</option>
<option value="08">08</option><option value="09">09</option>
<option value="10">10</option><option value="11">11</option>
<option value="12">12</option><option value="13">13</option>
<option value="14">14</option><option value="15">15</option>
<option value="16">16</option><option value="17">17</option>
<option value="18">18</option><option value="19">19</option>
<option value="20">10</option><option value="21">21</option>
<option value="22">22</option><option value="23">23</option>
</select>
: <select name=second size="1">
<option selected value="second"> second</option>
<option value="22">22</option><option value="23">23</option>
<option value="24">24</option><option value="25">25</option>
<option value="26">26</option><option value="27">27</option>
<option value="28">28</option><option value="29">29</option>
<option value="30">30</option><option value="31">31</option>
<option value="32">32</option><option value="33">33</option>
<option value="34">34</option><option value="35">35</option>
<option value="36">36</option><option value="37">37</option>
<option value="38">38</option><option value="39">39</option>
<option value="40">40</option><option value="41">41</option>
<option value="42">42</option><option value="43">43</option>
<option value="44">44</option><option value="45">45</option>
<option value="46">46</option><option value="47">47</option>
<option value="48">48</option><option value="49">49</option>
<option value="50">50</option><option value="51">51</option>
<option value="52">52</option><option value="53">53</option>
<option value="54">54</option><option value="55">55</option>
<option value="56">56</option><option value="57">57</option>
<option value="58">58</option><option value="59">59</option> </select></td></tr>
<tr><td align = left>ΈΤΟΣ ΠΑΡΑΓΩΓΗΣ:</td>
<td align=left><sel ect name=rel_year size="1" >
<option selected value="year">ye ar</option>
<option value="2000">20 00</option><option value="2001">20 01</option>
<option value="2002">20 02</option><option value="2003">20 03</option>
<option value="2004">20 04</option><option value="2005">20 05</option>
</select></td></tr>
<tr><td align = left>DVD COPIES:</td>
<td align=left><inp ut type=text size=2 name=DVD_COPIES MAXLENGTH=2 AUTOCOMPLETE=ON ></td></tr>

<tr><td align = left>VHS COPIES:</td><td align=left>
<input type=text size=2 name=VHS_COPIES MAXLENGTH=2></td>
</tr><tr><td align = left>XΡΟΝΟΣ <BR>ΕΝΟΙΚΙΑΣΗΣ: </td><td align=left>
<input type=text size=3 name=RENT_TIME MAXLENGTH=3>
</td></tr>
<tr><td align = left>ΤΙΜΗ:</td><td align=left><inp ut type=text size=4 name=PRICE MAXLENGTH=4 AUTOCOMPLETE=ON ></td></tr>
<tr><td align = left>ΑΡ.ΤΑΥΤΟΤΗ ΤΑΣ<BR>ΥΠΑΛΛΗΛΟ Υ*:</td>
<td align=left><inp ut type=text size=7 name=F_EMPLOYEE _ID MAXLENGTH=7 ></td></tr>

<tr><td align = left><BR>ΠΕΡΙΓΡ ΑΦΗ*:<p>
<textarea rows="5" cols=25 name=DESCRIPTIO N></textarea></td></p></tr>
<tr>
<td align=center colspan=2>
<br><input type=submit name=submit_bt value="ΚΑΤΑΧΩΡΗ ΣΗ">
<input type=reset name=reset_bt value="ΚΑΘΑΡΙΣΜ ΟΣ"></td></tr></table>
</form></font></center></body></html>

and reg_film.php

<html><body bgcolor="#6699F F"><center><fon t face=verdana>

<?php
$f_title=$_POST['F_TITLE'];
$dir_fname=$_PO ST['DIRECTOR_FNAME '];
$dir_lname=$_PO ST['DIRECTOR_LNAME '];
$type=$_POST['TYPE'];
$hour=$_POST['hour'];
$minute=$_POST['minute'];
$second=$_POST['second'];
$duration=$hour .':'.$minute.': '.$second;
$rel_year=$_POS T['rel_year'];
$d = "year";
$h = "hour:minute:se cond";
$descr=$_POST['DESCRIPTION'];
$dvd_cop=$_POST['DVD_COPIES'];
$vhs_cop=$_POST['VHS_COPIES'];
$rent_time=$_PO ST['RENT_TIME'];
$price=$_POST['PRICE'];
$f_em_id=$_POST['F_EMPLOYEE_ID'];
$check1 = -1;
$check2 = -1;
$conn=mysql_con nect("localhost ","root","" );
mysql_select_db ("video_club ");
if(!empty($dvd_ cop)){
if( $dvd_cop > 0 )
$check1 = 2;
else
$check1 = 1;
}
else
$check1 = 0;

if(!empty($vhs_ cop))
{
if( $vhs_cop > 0 )
$check2 = 2;
else
$check2 = 1;
}
else
{$check2 = 0;}

if (!empty($f_titl e) && !empty($dir_fna me) && !empty($dir_lna me) && !empty($type) && $rel_year != $d && !empty($price) && !empty($rent_ti me))
{

$query = "SELECT * FROM film WHERE F_TITLE = '$f_title'";
$rs = mysql_query($qu ery,$conn);
$num_rows = mysql_num_rows( $rs);

if ($num_rows > 0) {
ECHO "<BR><a href='form_reg_ film.htm'> return</a>";
mysql_close($co nn);exit();}

if($check1 > 0 )
;
else if($check2 > 0 )
;
else{
ECHO "<br><a href='form_reg_ film.htm'>retur n</a>";
exit();}
// Eisagogi sti vasi
$qr = "INSERT INTO actor VALUES ('";
$qr .= NULL . "','";
$qr .= $f_title . "','";
$qr .= $dir_fname . "','";
$qr .= $dir_lname . "','";
$qr .= $type . "','";

if($duration == $h)
{$qr .= NULL. "','";}
else
{$qr .= $duration . "','";}

if($rel_year == $d)
{$qr .= NULL . "','";}
else
{$qr .= $rel_year . "','";}

if(empty($descr ))
{$qr .= NULL . "','";}
else
{$qr .= $descr . "','"; }
$qr .= $rent_time . "','";
$qr .= $price . "','";
if(empty($f_em_ id))
{$qr .= NULL. "')";}
else
{$query = "SELECT * FROM employee WHERE E_ID = 'f_em_id'";
$res = mysql_query($qu ery,$conn);
$rows = mysql_num_rows( $res);

if ($rows > 0)
{$qr .= $f_em_id . "')";}
else
{
ECHO "<br><a href='form_reg_ film.htm'>ΕΠΙΣΤ ΡΟΦΗ</a>";

$r = mysql_query($qr ) or die('ΛΑΝΘΑΣΜΑΝΟ Σ ΚΩΔΙΚΟΣ ΕΡΓΑΖΟΜΕΝΟΥ ' . mysql_error());
exit();
}
}

$rs = mysql_query($qr ) or die('ΑΔΥΝΑΤΗ Η ΕΓΓΡΑΦΗ ΤΗΣ ΝΕΑΣ ΤΑΙΝΙΑΣ: ' . mysql_error());
$insert_id = mysql_insert_id ();

$qu = "INSERT INTO dvd_copies VALUES ('";
$qu .= $insert_id . "','";
$qu .= $check1 . "','";
$qu .= $dvd_cop . "')";
$rs = mysql_query($qu ) or die('Query failed: ' . mysql_error());


$que = "INSERT INTO vhs_copies VALUES ('";
$que .= $insert_id . "','";
$que .= $check2 . "','";
$que .= $vhs_cop . "')";
$rs = mysql_query($qu e) or die('Query failed: ' . mysql_error());

mysql_close($co nn);
ECHO "Η ΕΓΓΡΑΦΗ ΤΗΣ ΤΑΙΝΙΑΣ ΕΙΝΑΙ ΕΠΙΤΥΧΗΣ!";
}
else
{
ECHO "Η ΕΓΓΡΑΦΗ ΤΗΣ ΤΑΙΝΙΑΣ ΑΠΕΤΥΧΕ!";
ECHO "<BR>ΠΡΟΣΠΑΘΗΣΤ Ε ΞΑΝΑ!";
mysql_close($co nn);
}

?>
</body>
</html>

but when i try to insert i have this error:
Column count doesn't match value count at row 1

i saw for differrences in variables names , the number of columns but nothing...
anything to propose...????
thanks in advanced!!!!!
Jul 7 '06 #1
0 4100

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
10771
by: Aaron C | last post by:
Hi, I'm trying to do an insert with the following statement: INSERT INTO user VALUES ( 'ag@ag.com','ag','Aaron','Chandler','','','La Mirada','CA',90638,714,'',''); and I'm getting the error message "Column count doesn't match value count at row 1".
1
4048
by: Dmitry V. Markin | last post by:
Good day! Here is my problem: I need to have a radiobutton column in my DataGrid for a representation of a bool column, where only row can be checked at one time(only one value in bool column can be true). So I've created a class inheriting from DataGridColumnStyle and added the following code to the class: protected RadioButton rb ; ....
6
5072
by: Alpha | last post by:
I retrieve a table with only 2 columns. One is a auto-generated primary key column and the 2nd is a string. When I add a new row to the dataset to be updated back to the database. What should I do with the 1st column ? (Below I have a "1" in place for now). Also, Does the datase.AcceptChanges(); updates the changes to the database? Which command do I use to update the changes in dataset back to the Access database table? Thanks, Alpha...
23
2901
by: Gary Wessle | last post by:
Hi I have a vector<charwhich looks like this (a d d d a d s g e d d d d d k) I need to get the biggest count of consecutive 'd'. 5 in this example I am toying with this method but not sure if it is optimal. thanks int k = 0;
5
5514
by: John | last post by:
I just cannot manage to perform a SELECT query with NULL parameter... My CATEGORY table does have one row where TCATEGORYPARENTID is null (real DB null value). TCATEGORYID and TCATEGORYPARENTID are uniqueidentifier columns. My questions: - is Type="Object", below, necessary? - what shall I specify for DefaultValue in my function? I tried everything.
6
5973
by: Jay | last post by:
I need to convert from a string a double that is followed by a scaling character (k means *1e3, M=*1e6, etc) then apply the scaling character. Example: "-1.345k #comment" I know roughly how to do this in C (using the %n in the sscanf format specifier to find the number of characters converted) , but how do I do it in C#? My problem is how to count the number of characters of the double (chpos in the C example) so that the scaling...
0
2101
by: Joe Meng | last post by:
Greetings, I've seen this question asked and answered here, just not completely yet. I'm wondering how to use a column value as a table name in another query. So far it's looking like you must use dynamic SQL, external to DB2. An example: TableX contains column TabName, which is populated by the names of tables in the database. Each of these named tables contains a field called "VID". I wish to match some value of VID in each of...
1
1792
by: Byomokesh | last post by:
Hi I am trying to cell count and match in tgroup cols value in XML file. if cell count and tgrou cols value is mismatch, its showing error. My xml -------------- <tgroup cols="3"> <colspec colnum="1" colname="col1"/> <colspec colnum="2" colname="col2"/> <colspec colnum="3" colname="col3"/>
6
1833
by: ashraf02 | last post by:
hi i am trying to insert a record via a form using php and mysql and when i try to submit the form it comes up with the following error Column count doesn't match value count at row 1 if someone can please help me overcome this error i would be grateful. the insert_shirt.php code is:
0
9591
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9425
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
7415
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6676
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5312
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5449
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3970
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3575
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2816
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.