Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8041315
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T04:10:20+00:00 2026-06-05T04:10:20+00:00

I have this query represented as a string (its shortened to make it easier

  • 0

I have this query represented as a string (its shortened to make it easier to read):

$query = 'INSERT INTO mytable (ke_voucher_date) VALUES (\'%s\')';

Now this is what I do next:

$query = vsprintf($query, array_map('mysql_real_escape_string', $params));
mysql_query($query);

$params is an array holding all values that should be saved, in this case (because its shortened) only the date in the format dd.mm.yyyy (21.04.2012). The result is 21.04.2026 for example. Whats wrong with the code, ideas? Maybe the %s?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T04:10:22+00:00Added an answer on June 5, 2026 at 4:10 am

    “21.04.2012” is not a format MySQL likes. You should always format your dates as Y-m-d, e.g. 2012-04-21.

    Although MySQL tries to interpret values in several formats, date parts must always be given in year-month-day order (for example, ’98-09-04′), rather than in the month-day-year or day-month-year orders commonly used elsewhere (for example, ’09-04-98′, ’04-09-98′).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have this query: SELECT HOUR( DATE ) AS hr, COUNT( * ) AS cnt
I have this query: mysql_select_db('scanner'); $query = SELECT * FROM scanner.proxy ORDER BY RAND()
I have this query: SELECT Book.title, Book.copyright, Book.publisher, Book.id, MaterialType.type, Item.id as item_id, 100
I have this query in Mysql SELECT z.virtuemart_product_id,z.product_name,d.product_price FROM x5lui_virtuemart_products x inner join x5lui_virtuemart_products_en_gb
I have this query and result in my database: mysql> SELECT id FROM jos_content
I have this query: update sales_flat_quote set customer_email = (concat(select substring(md5(rand()) from 1 for
I have this query Dasha.Where(x => x[15] == 9).ForEachWithIndex((x,i) => dd[Sex[i]][(int)x[16]]++); This query is
I have this query: select comment_id , section_name , comment , solution_part , display_order
I have this query (which works fine in mySQL cmdline), but when I run
I have this query this.FixturePartidoPuntaje.Load(); var partidos = from q in this.FixturePartidoPuntaje where (

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.