Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > SQL Language
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old June 5th, 2013, 03:03 PM
Registered User
Join Date: Jun 2013
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to create variable into query mysql…?

for the mysql user, I have a problem about how to make a variable into mysql query. I want to create a variable to detect the system (years) on the computer. formatdatetime('yyyy',now)

please help me

because later I use to call the table in the database example: 2013_peserta, 2012_peserta, 2011_peserta, 2011_nilai, etc.
Old July 4th, 2013, 04:49 AM
Registered User
Join Date: Jul 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts

Isn't it possible by just assigning the variable in your script... so you do a $GET blalba = $years.

And then do a insert into the table just give the value $years and it should work? Or isn't this what you ment?

Similar Threads
Thread Thread Starter Forum Replies Last Post
create an element using a variable for the name brenchley XSLT 2 December 9th, 2005 09:46 AM
create a variable dynamically in JavaScript crmpicco Javascript How-To 2 October 4th, 2005 06:14 AM
Can I create a class from a variable? MAtkins General .NET 2 August 1st, 2005 11:57 AM
create a new variable in javascript crmpicco Classic ASP Basics 2 February 2nd, 2005 12:53 PM
how to create Global Variable VIshwastrivedi SQL Server 2000 5 September 30th, 2004 08:38 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.