#10394 [Com]: mysql_query() dosen't stable!
| From: | site-free1046 at hotmail dot com | Date: | Tue, 20 Jul 2004 15:01:09 +0000 |
| Subject: | #10394 [Com]: mysql_query() dosen't stable! | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-62798@lists.php.net to get a copy of this message | ||
ID: 10394
Comment by: site-free1046 at hotmail dot com
Reported By: ttttntl at yahoo dot com
Status: Bogus
Bug Type: MySQL related
Operating System: Linux RedHat7
PHP Version: 4.0.4pl1
New Comment:
<a href=http://quallityunordinary.da.ru>site
free</a>
Previous Comments:
------------------------------------------------------------------------
[2001-06-02 22:47:12] sniper@php.net
use addslashes() on data you put into db.
------------------------------------------------------------------------
[2001-04-19 05:55:43] ttttntl at yahoo dot com
Hi,
I have a table:
CREATE TABLE boardlist (
board_id int(11) DEFAULT '0' NOT NULL,
header_inc mediumtext NOT NULL,
footer_inc mediumtext NOT NULL,
board_width varchar(10) NOT NULL,
board_align varchar(10) NOT NULL,
name varchar(50) NOT NULL,
description varchar(255) NOT NULL,
admin varchar(20) NOT NULL,
password varchar(20) NOT NULL,
email varchar(50) NOT NULL,
mail_reply tinyint(4) DEFAULT '0' NOT NULL,
color1 varchar(20) NOT NULL,
color2 varchar(20) NOT NULL,
color3 varchar(20) NOT NULL,
color4 varchar(20) NOT NULL,
color5 varchar(20) NOT NULL,
img_id tinyint(4) DEFAULT '0' NOT NULL,
btn_id tinyint(4) DEFAULT '0' NOT NULL,
rows tinyint(4) DEFAULT '10' NOT NULL,
pages tinyint(4) DEFAULT '10' NOT NULL,
image_path1 varchar(50) NOT NULL,
image_path2 varchar(50) NOT NULL,
image_path3 varchar(50) NOT NULL,
id_check tinyint(4) DEFAULT '0' NOT NULL,
writer_check tinyint(4) DEFAULT '0' NOT NULL,
date_check tinyint(4) DEFAULT '0' NOT NULL,
point_check tinyint(4) DEFAULT '0' NOT NULL,
counter_check tinyint(4) DEFAULT '0' NOT NULL,
image_check tinyint(4) DEFAULT '0' NOT NULL,
text_check tinyint(4) DEFAULT '0' NOT NULL,
color_check tinyint(4) DEFAULT '0' NOT NULL,
bg_image_check tinyint(4) DEFAULT '0' NOT NULL,
bg_color_check tinyint(4) DEFAULT '0' NOT NULL,
usertype tinyint(4) DEFAULT '0' NOT NULL,
write_check tinyint(4) DEFAULT '0' NOT NULL,
update_check tinyint(4) DEFAULT '0' NOT NULL,
delete_check tinyint(4) DEFAULT '0' NOT NULL,
reply_check tinyint(4) DEFAULT '0' NOT NULL,
upload_check tinyint(4) DEFAULT '0' NOT NULL,
PRIMARY KEY (board_id)
);
------------
and use:
$board_id=2;
$sql="insert boardlist(board_id, header_inc, footer_inc, board_width,
board_align, name, description, admin, password, email, mail_reply,
color1, color2, color3, color4, color5, img_id, btn_id, rows, pages,
image_path1, image_path2, image_path3, id_check, writer_check,
date_check, point_check, counter_check, image_check, text_check,
color_check, bg_image_check, bg_color_check, usertype,write_check,
update_check, delete_check, reply_check, upload_check)
values('$board_id', '', '', '80%', 'left',
'Board', 'Board', 'admin',
'1323', '', '0', '#7DA7D9', '#E1E1FA',
'#FFFFFF', '#D0D0FC', '#D0D0FC',
'1', '1', '10', '10','http://user.chollian.net/~dawn0121/icon.htm',
'',
'', '1', '1', '1', '1', '1',
'1', '1', '1', '1', '1', '0',
'1', '1',
'1', '1', '1');";
//$sql="insert into boardlist(board_id) values(".$board_id.")";
mysql_query($sql) or die(mysql_error()."<br>sql==".$sql);
echo $sql;
------------------
Sometime it works (inserts ok) but sometime doesn't (without notice an
error!).
When it doesn't, I copy the sql statement from echo $sql result, paste
into mysql command line,and run, but it always works!!
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=10394&edit=1