Solved

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

Posted on 2007-03-21
1
188 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
splitting a sting into elements 6 76
Export Data from MySql Using PHP 16 67
Ajax success not firing alert 6 45
Prestashop modules custimzation 2 29
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

752 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