array!!?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
andre_c
Forum Contributor
Posts: 412
Joined: Sun Feb 29, 2004 6:49 pm
Location: Salt Lake City, Utah

Post by andre_c »

well, is there a column named amazon_user on the db_cam_amazon table?
BT-loader
Forum Commoner
Posts: 31
Joined: Fri Dec 17, 2004 5:29 pm
Location: SWEDEN

Post by BT-loader »

andre_c wrote:well, is there a column named amazon_user on the db_cam_amazon table?
No, but i have created one. :?

But i don´t really know what "values" and "attributes" to use.

Here is the whole table:

Code: Select all

CREATE TABLE `db_cam_amazon` (
  `amazon_id` int(15) NOT NULL auto_increment,
  `amazon_asin` varchar(25) NOT NULL default '',
  `amazon_title` text NOT NULL,
  `amazon_cat` varchar(25) NOT NULL default '',
  `amazon_user` varchar(255) NOT NULL default '',
  UNIQUE KEY `amazon_id` (`amazon_id`)
) TYPE=MyISAM AUTO_INCREMENT=4 ;
User avatar
andre_c
Forum Contributor
Posts: 412
Joined: Sun Feb 29, 2004 6:49 pm
Location: Salt Lake City, Utah

Post by andre_c »

does the script work now?
if not, post the errors
BT-loader
Forum Commoner
Posts: 31
Joined: Fri Dec 17, 2004 5:29 pm
Location: SWEDEN

Post by BT-loader »

Hi again! Thanks for your concern. ;)

There are still some minor "errors" in this script, and i was wondering if you could help me with them??
BT-loader
Forum Commoner
Posts: 31
Joined: Fri Dec 17, 2004 5:29 pm
Location: SWEDEN

Post by BT-loader »

Everytime i try to change something within the "user cp" or "admin cp" of the script, i allways get

Code: Select all

Unknown column 'a37' in 'field list'
or

Code: Select all

Unknown column 'p29' in 'field list'
..and when i tried to add both fields to the table, it just ask for a new one (+1).

Code: Select all

Unknown column 'a38' in 'field list'
or

Code: Select all

Unknown column 'p30' in 'field list'
How can i "stopp" this...? 8O
User avatar
andre_c
Forum Contributor
Posts: 412
Joined: Sun Feb 29, 2004 6:49 pm
Location: Salt Lake City, Utah

Post by andre_c »

post the code around the query that throws that error, sounds like there's something wrong with the query, not the table
BT-loader
Forum Commoner
Posts: 31
Joined: Fri Dec 17, 2004 5:29 pm
Location: SWEDEN

Post by BT-loader »

Here is some code for the first part...

edit_int.php

Code: Select all

<?
$email = $HTTP_COOKIE_VARS&#1111;"email"];
$password = $HTTP_COOKIE_VARS&#1111;"password"];

if ($email == '') &#123;
Header("Location: index.php?error=pw");
&#125;
if ($password == '') &#123;
Header("Location: index.php?error=pw");
&#125;
require("config.php");

mysql_connect ("$servername", "$dbusername", "$dbpassword")
or die ("Could not connect");
mysql_select_db("$dbname");

$q = "update db_cam_int set a01='$a01',a02='$a02',a03='$a03',a04='$a04',a05='$a05',a06='$a06',a07='$a07',a08='$a08',a09='$a09',a10='$a10',a11='$a11',a12='$a12',a13='$a13',a14='$a14',a15='$a15',a16='$a16',a17='$a17',a18='$a18',a19='$a19',a20='$a20',a21='$a21',a22='$a22',a23='$a23',a24='$a24',a25='$a25',a26='$a26',a27='$a27',a28='$a28',a29='$a29',a30='$a30',a31='$a31',a32='$a32',a33='$a33',a34='$a34',a35='$a35',a36='$a36',a37='$a37',a38='$a38',a39='$a39',a40='$a40',a41='$a41',a42='$a42',a43='$a43',a44='$a44',a45='$a45',a46='$a46',a47='$a47',a48='$a48',a49='$a49',a50='$a50',a51='$a51',a52='$a52',a53='$a53',a54='$a54',a55='$a55' where int_id = '$id'";
mysql_query($q) or die(mysql_error());

Header("Location: edit_main.php?edit=int&saveinfo=ok");
?>
BT-loader
Forum Commoner
Posts: 31
Joined: Fri Dec 17, 2004 5:29 pm
Location: SWEDEN

Post by BT-loader »

Second part...

edit_pro.php

Code: Select all

<?
$email = $HTTP_COOKIE_VARS&#1111;"email"];
$password = $HTTP_COOKIE_VARS&#1111;"password"];

if ($email == '') &#123;
Header("Location: index.php?error=pw");
&#125;
if ($password == '') &#123;
Header("Location: index.php?error=pw");
&#125;
require("config.php");

mysql_connect ("$servername", "$dbusername", "$dbpassword")
or die ("Could not connect");
mysql_select_db("$dbname");

$p01 = strip_tags($p01);
$p02 = strip_tags($p02);
$p03 = strip_tags($p03);
$p04 = strip_tags($p04);
$p05 = strip_tags($p05);
$p06 = strip_tags($p06);
$p07 = strip_tags($p07);
$p08 = strip_tags($p08);
$p09 = strip_tags($p09);
$p10 = strip_tags($p10);
$p11 = strip_tags($p11);
$p12 = strip_tags($p12);
$p13 = strip_tags($p13);
$p14 = strip_tags($p14);
$p15 = strip_tags($p15);
$p16 = strip_tags($p16);
$p17 = strip_tags($p17);
$p18 = strip_tags($p18);
$p19 = strip_tags($p19);
$p20 = strip_tags($p20);
$p21 = strip_tags($p21);
$p22 = strip_tags($p22);
$p23 = strip_tags($p23);
$p24 = strip_tags($p24);
$p25 = strip_tags($p25);
$p26 = strip_tags($p26);
$p27 = strip_tags($p27);
$p28 = strip_tags($p28);
$p29 = strip_tags($p29);
$p30 = strip_tags($p30);
$p31 = strip_tags($p31);
$p32 = strip_tags($p32);
$p33 = strip_tags($p33);
$p34 = strip_tags($p34);
$p35 = strip_tags($p35);
$p36 = strip_tags($p36);
$p37 = strip_tags($p37);
$p38 = strip_tags($p38);
$p39 = strip_tags($p39);
$p40 = strip_tags($p40);
$p41 = strip_tags($p41);
$p42 = strip_tags($p42);
$p43 = strip_tags($p43);
$p44 = strip_tags($p44);
$p45 = strip_tags($p45);
$p46 = strip_tags($p46);
$p47 = strip_tags($p47);

if($del_profile=="1")&#123;
$q1 = "update db_cam_profiles set p01='',p02='',p03='',p04='',p05='',p06='',p07='',p08='',p09='',p10='',p11='',p12='',p13='',p14='',p15='',p16='',p17='',p18='',p19='',p20='',p21='',p22='',p23='',p24='',p25='',p26='',p27='',p28='',p29='',p30='',p31='',p32='',p33='',p34='',p35='',p36='',p37='',p38='',p39='',p40='',p41='',p42='',p43='',p44='',p45='',p46='',p47='' where profile_id = '$id'";
mysql_query($q1) or die(mysql_error());
&#125; else &#123;
$q2 = "update db_cam_profiles set p01='$p01',p02='$p02',p03='$p03',p04='$p04',p05='$p05',p06='$p06',p07='$p07',p08='$p08',p09='$p09',p10='$p10',p11='$p11',p12='$p12',p13='$p13',p14='$p14',p15='$p15',p16='$p16',p17='$p17',p18='$p18',p19='$p19',p20='$p20',p21='$p21',p22='$p22',p23='$p23',p24='$p24',p25='$p25',p26='$p26',p27='$p27',p28='$p28',p29='$p29',p30='$p30',p31='$p31',p32='$p32',p33='$p33',p34='$p34',p35='$p35',p36='$p36',p37='$p37',p38='$p38',p39='$p39',p40='$p40',p41='$p41',p42='$p42',p43='$p43',p44='$p44',p45='$p45',p46='$p46',p47='$p47' where profile_id = '$id'";
mysql_query($q2) or die(mysql_error());
&#125;

Header("Location: edit_main.php?edit=personal&saveinfo=ok");
?>
User avatar
andre_c
Forum Contributor
Posts: 412
Joined: Sun Feb 29, 2004 6:49 pm
Location: Salt Lake City, Utah

Post by andre_c »

that query expects all of those columns (p01 to p47) to exist.
If they don't, you will keep getting errors.
It seems like a poorly designed system by the look of the query and all of those fields.
BT-loader
Forum Commoner
Posts: 31
Joined: Fri Dec 17, 2004 5:29 pm
Location: SWEDEN

Post by BT-loader »

But all those columns IS existing in the database.

So now what..!?
User avatar
andre_c
Forum Contributor
Posts: 412
Joined: Sun Feb 29, 2004 6:49 pm
Location: Salt Lake City, Utah

Post by andre_c »

Code: Select all

Unknown column 'p30' in 'field list'
means that the 'p30' column doesn't exist on the db_cam_profiles tables
are you positive that it does exist?
BT-loader
Forum Commoner
Posts: 31
Joined: Fri Dec 17, 2004 5:29 pm
Location: SWEDEN

Post by BT-loader »

Hmm..!?

I hade p01-p28.

This script is very strange.

I´m gonna add all the other columns right now, hope it helps!?
BT-loader
Forum Commoner
Posts: 31
Joined: Fri Dec 17, 2004 5:29 pm
Location: SWEDEN

Post by BT-loader »

I have added all the missing columns now, so the "error" is gone. :D

But it seems that the info isn´t stored in the columns. :(

Do i need to add something to the code or what??
User avatar
andre_c
Forum Contributor
Posts: 412
Joined: Sun Feb 29, 2004 6:49 pm
Location: Salt Lake City, Utah

Post by andre_c »

was the script ever working?
BT-loader
Forum Commoner
Posts: 31
Joined: Fri Dec 17, 2004 5:29 pm
Location: SWEDEN

Post by BT-loader »

The script is working, but there are some things that isn´t. :(

Can you PLEASE continue to help me?
Post Reply