|
| ||||||||||
| Tags: mysql, php, query |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| Use variables in a MySQL query
I have a problem during the creation of my site .. the idea is to use a PHP variable in a query Mysql. possible or not?! and how? thank you ... |
|
#2
| ||||
| ||||
| Re: Use variables in a MySQL query
Hi, you can save your variables between single quotes if I remember correctly, style $ ta_variable = 'ab'; "SELECT * FROM ta_base WHERE = '$ ta_variable" |
|
#3
| |||
| |||
| Re: Use variables in a MySQL query
thank you, but you can do: $ ta_variable = $ _POST [ 'variable'];?? |
|
#4
| |||
| |||
| Re: Use variables in a MySQL query
Hi, If your variable has a form, you can directly integrate your $ _POST variable in the request for the concatenation in your application: mysql_query ( "UPDATE` `tabase. taTable` SET `tonChamp = '". $ variableChamp. "' WHERE tonChamp = '". $ _POST [' variable ']. "'") or die (mysql_error ()); |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "Use variables in a MySQL query" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| MySQL query in a query | Rail racer | Software Development | 3 | 21-07-2009 07:06 PM |
| Turn on MySQL query cache to speed up query performance | DMA2Superman | Software Development | 3 | 07-07-2009 10:26 AM |
| MySQL Query Cache | Ryder | Software Development | 3 | 16-04-2009 03:05 PM |
| MySQL IF ELSE in Query | Ryder | Software Development | 3 | 27-03-2009 05:24 PM |
| Passing variables in SQL Query | Braze | Software Development | 2 | 01-01-2009 07:52 PM |