PDA

View Full Version : MySQL Trouble :S



splintercell!
24-08-2005, 07:06 PM
Column count doesn't match value count at row 1... is what I get when I try submitting something from a form to a database table. Any ideas how to fix this. My handler is flawless as far as I can tell leading me to think its a problem with how i've set my table up. Any tips or anything :S

JoeComins
24-08-2005, 07:15 PM
I have no idea, but I have to bask in the glory that your asking to help.

I will ask someone on my MSN see if they know. He knows loads

splintercell!
24-08-2005, 08:16 PM
yes Im asking for something abit more advanced that how to write a link or how to create a table :)

:Lemmings.
24-08-2005, 09:00 PM
Lmao thats a bit south of the belt.

мϊкэ
25-08-2005, 01:22 PM
yes Im asking for something abit more advanced that how to write a link or how to create a table :)

http://www.xenigma.net/index.php?page=tutorials/php/4 ?
at the top it tells you how to create a table "/ or you can do it with php :D


<?php
$username = "";//your username
$password = "";//your password
$host = "localhost";//your mySQL server
$database = "";//The name of the database your table is in

mysql_connect($host,$username,$password) or die("Error connecting to Database!<br>" . mysql_error());//connect, but if there is a problem, display an error message telling why there is a problem
mysql_select_db($database) or die("Cannot select database!<br>" . mysql_error());//Choose the database from your mySQL server, but if there is a problem, display an error telling why

//create the table, customize it if you want
$query = 'CREATE TABLE !!!TABLE NAME!!! (
id INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY(id),
!!!ROW NAME 1!!! VARCHAR(30) NOT NULL,
!!!ROW NAME 2!!! VARCHAR(20) NOT NULL,
!!!ROW NAME 3!!! VARCHAR(40) NOT NULL)';

$result = mysql_query($query);

echo "Table Created!";
?>

you just need to fill in your details :D and the table name and row name

splintercell!
25-08-2005, 02:06 PM
I just used a flat file in the end which worked just as well "/ but thanks ill read through it because Ive never really been able to find a decent tutorial for MySQL tables etc :) +rep if I can..

Want to hide these adverts? Register an account for free!