Page 2 of 2

Posted: Mon Jan 05, 2004 2:51 pm
by robster
This is getting interesting! :) Thanks so much again for keeping on me with this.


You say:
INSERT INTO mytable (year, month, day) VALUES ($year, $month, $day)

assuming that year, month and day are integer fields.

If they are varchars, then you'd have to go:

INSERT INTO mytable (year, month, day) VALUES ('$year', '$month', '$day')
Would it therefore be possible to mix them together in the one INSERT line like this?

Code: Select all

INSERT INTO mytable (year, month, day, textfield1, texfield2) VALUES ($year, $month, $day, '$text1', '$text2')
(I'm going to try it anyway but I thought I'd get your opinion. I wonder if this could be my problem. My only concern is that it works on some peoples and not on others (all using the same website/server).

Did my error message help at all btw?

Thanks again :)

Rob

Posted: Mon Jan 05, 2004 4:17 pm
by robster
OK i did JUST that, my query is now like this:

Code: Select all

$Add = mysql_db_query ($dbname, "INSERT INTO current (id,uid,year,month,number,title,animator,hardware,software,creationtime,rendertime,viewrecommend,animdescription,descriptionofcreation,popularity,mpg,jpg,rating,ratingafter,winner)
   VALUES ($forum_uid, $forum_uid, $sound_year, $sound_month, $new_id, '$title', '$animator', '$hardware', '$software', '$creationtime', '$rendertime', '$viewrecommend', '$animdescription', '$descriptionofcreation', 0, '$mpgfilename', '$jpgfilename', 0, 0, 0)") or die(Mysql_Error());

AND..... (drumrollllllll) IT WORKS!!!!

The whole thing works on a system that previously it wouldn't work with!!! I'm so bloooody stoked!

I just want to thank everyone who helped me with this, and I hope a few others learn from it too.. You can't imagine how much this is going to help out :)


!!


Rob

Posted: Mon Jan 05, 2004 8:31 pm
by microthick
Congrats Rob :P

Posted: Tue Jan 06, 2004 2:10 pm
by robster
Even more appropriately, thank you Microthick and everyone else! What a great community this is :)

Rob

Posted: Tue Jan 06, 2004 7:19 pm
by infolock
single quotes work fine for me too.