Solved

How do i write phrase php variables in the SELECT statement.

Posted on 2007-03-21
1
180 Views
Last Modified: 2012-06-21
How would i write this?

If the country was 'australia' and I wanted the select statement to look like this "SELECT * FROM tbl_australia and so on

How would I write it?

I tried a few examples:

"SELECT * FROM tbl_'$country'
0
Comment
Question by:Alpha_AI
1 Comment
 
LVL 17

Accepted Solution

by:
HuyBD earned 50 total points
ID: 18769432
'SELECT * FROM tbl_'.$country
or
"SELECT * FROM tbl_$country"

HuyBD;
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now