
Pikachu2000
Staff Alumni-
Posts
11,369 -
Joined
-
Last visited
-
Days Won
11
Pikachu2000 last won the day on May 7 2016
Pikachu2000 had the most liked content!
About Pikachu2000

- Birthday April 27
Profile Information
-
Gender
Male
-
Location
Future Independent Republic of Texas
-
Interests
Paper bags, shiny objects, kumquats, 12th century automobiles.
-
Age
106
Recent Profile Visitors
7,774 profile views
Pikachu2000's Achievements
-
As long as you're editing things, you'll probably find debugging a lot easier if you make the query string readable by getting rid of all that obnoxious concatenation. $query = "INSERT INTO image ( title, type, name, alt, img, description, date) VALUES ( '$title', '{$_FILES['userFile']['type']}', '{$_FILES['userFile']['name']}', '$alt', '$image', '$description', NOW() )";
-
You want the MySQL function NOW(), not $NOW(), and it shouldn't be in quotes in the query string.
-
I'm assuming since you posted in the MS SQL forum, you're indeed using Microsoft SQL? If so, here are all of the mssql functions: http://us1.php.net/manual/en/ref.mssql.php If not, what database are you using?
-
You've say echoed the whole query when the error occurs? Post that as well. INT(2) only sets the display width, not the number of digits the field can hold, a single '1' would be padded with a zero to read '01'.
-
I'm going to guess that $id has no value. If the `id` field in the database is an autoincrement field, you can just leave it out of the query entirely. Why use INT(2) by the way?
-
You aren't executing the query, you're just passing the variable containing the query string (as would be implied by "string given") to mysql_fetch_array().
-
Why did you change it to something you didn't want, when there was a message clearly indicating you can only change it once a year?
-
MySQL's DATE() function should help you. SELECT field FROM table WHERE DATE(datetime_field) BETWEEN '2010-01-02' AND '2011-12-31'
-
This topic has been moved to Introductions. http://www.phpfreaks.com/forums/index.php?topic=355488.0
-
Most of your problem is in the way you're quoting things. String values get enclosed in single 'quotes'. Normally, table and field names don't need to be enclosed in anything unless they happen to be MySQL reserved words, in which case, they get enclosed in `backticks`. Backticks are not used in the php functions to connect to the db.