Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsDiscussion Forum → Since there are so many PHP programmers..
Since there are so many PHP programmers..
2009-03-27, 1:53 PM #1
I am having a hell of a time right now, I've been troubleshooting for like 24 hours straight.

Syntax is 100% correct. I have a script, I have a mysql INSERT statement that I execute, mysql_query() returns true on the insert, but _affected_rows() return nothing.

However, my Autoindex for ID, is incrementing in my database, like it is trying to add something, or it is, and then it is being deleted. I've checked MySQL logs but they tell me nothing.

Any thoughts? It does this on both my wamp server and unix
"Nulla tenaci invia est via"
2009-03-27, 2:07 PM #2
Possibly related:

http://bugs.mysql.com/bug.php?id=37560

What version mysql (and php) are you running, by the way?
一个大西瓜
2009-03-27, 2:16 PM #3
php 5.2.8
mysql 5.1.30

What I failed to mention before, was this all stemmed from an earlier issue that was very similar. Further in the script, I had a different insert statement, above it I had a delete statement. When it was executed it would insert 2 rows, one of the columns had a random string generated and each column was different, which made me think the PHP was executed twice. When I removed the delete statement, it would insert 1 row but leave out half of the columns data, and the autoindex would increment by 2. When I came up with a solution for that, this latest problem occurred.

In my database class, I saved all the queries to an array and at the end of the script I output that ****. And to my surprise everything was correct, if I copied each query individually they would work directly inserted into mysql. Only 11 queries were being executed total for the entire script.
"Nulla tenaci invia est via"
2009-03-27, 2:42 PM #4
affected_rows returns nothing? It should always return SOMETHING, be it -1 for failed query, 0-infinity for rows affected.
2009-03-27, 2:42 PM #5
I think by 'nothing' he means 0 not null.
一个大西瓜
2009-03-27, 2:48 PM #6
as a matter of fact, no it returns nothing
"Nulla tenaci invia est via"
2009-03-27, 2:53 PM #7
Oh. What.
一个大西瓜
2009-03-27, 2:58 PM #8
I dunno I'm about to burn this whole thing
"Nulla tenaci invia est via"
2009-03-27, 3:18 PM #9
You have a proper link identifier set for it, right?
2009-03-27, 4:44 PM #10
I did, but actually I just saw it was commented out
"Nulla tenaci invia est via"
2009-03-31, 2:21 AM #11
I finally found the problem, you ready for this

<img id="banner" src="" width="120" height="113" />
"Nulla tenaci invia est via"
2009-03-31, 2:22 AM #12
hahahahahaha
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2009-03-31, 6:02 AM #13
It's times like that I really, really, really hate programming.
My Parkour blog
My Twitter. Follow me!
2009-03-31, 6:48 AM #14
Yeah, that's so "PHP". :P

Next time post sauce!
2009-03-31, 7:40 AM #15
Try the query directly in MySQL console tool or PHPmyadmin or something to make sure the query itself isn't the problem.

2009-03-31, 8:24 AM #16
Originally posted by The Mega-ZZTer:
Try the query directly in MySQL console tool or PHPmyadmin or something to make sure the query itself isn't the problem.


MZZT didn't read the thread!

Not only did he try that, he's found and fixed the problem. :neckbeard:
2009-03-31, 9:52 AM #17
Oh.

Haha src="", hahahaha.

2009-03-31, 3:24 PM #18
LAWL.
? :)
2009-03-31, 4:32 PM #19
I'm thoroughly confused as to what an img tag with a blank src tag has anything to do with an INSERT statement.
the idiot is the person who follows the idiot and your not following me your insulting me your following the path of a idiot so that makes you the idiot - LC Tusken
2009-03-31, 4:52 PM #20
Take avatars on the typical vBulletin forum, Wolfy. Since the avatars are typically stored in the MySQL DB, a query is ran to obtain a user's avatar from the DB. There is a script such as "avatar.php" which sole purpose is to do this. The avatar.php would be called from the img tag where the avatar would go, and the avatar.php would return the avatar.

↑ Up to the top!