Jump to content

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

Prolific Member

Prolific Member (5/5)

121

Reputation

1

Community Answers

  1. 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() )";
  2. You want the MySQL function NOW(), not $NOW(), and it shouldn't be in quotes in the query string.
  3. 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?
  4. 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'.
  5. 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?
  6. 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().
  7. 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?
  8. MySQL's DATE() function should help you. SELECT field FROM table WHERE DATE(datetime_field) BETWEEN '2010-01-02' AND '2011-12-31'
  9. This topic has been moved to Introductions. http://www.phpfreaks.com/forums/index.php?topic=355488.0
  10. 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.
  11. You're using single 'quotes' where you should be using `backticks`.
  12. Where did you get that IP address from? Is MySQL on your local machine, or is it on a hosted server?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.