check how many commas the variable containing the query has between [i]select[/i


Posted on 16th Feb 2014 07:03 pm by admin

Hi...

iv made an sql table that contains id number - name of sql query and an sql query.
The problem is that the table contains very different querys.
Did you know?Explore Trending and Topic pages for more stories like this.

On the first page you choose a query from a drop down menu.
When this is done i check if the query contains date as a parametre. if yes a date picker is desplayed.
When a date is picked the report runs when submited.

i want the results of the query to be displayed in a html table and need help to figure out how many rows the sql query output needs.
For example
select firstname, lastname from users
needs two rows and
select firstname, lastname, birthdate from users
needs three rows.

my solution is maybe to check how many commas the variable containing the query has between select and from
any one know how this can be done in php or maybe have a simpler way of solving this?
No comments posted yet

Your Answer:

Login to answer
329 Like 14 Dislike
Previous forums Next forums
Other forums

single values into sql field
i have a form which i want the user to able to select multiple answers. But i want the answers to be

why aint this working?
i have this code:

Code: $num = 250;
$count = ($num - $rcount);

echo $rc

problems with php variables in mysql query
i can't seem to get the following query to work.

select $q1c from $vote_rate where id = $re

understanding functions and classes
Code: [Select]
class person {
var $name = "Jimmy Goe";

function get_nam

problems with contact forms that are only protected against SQL injections
What could be a potential problem with contact forms that are only protected against SQL injections

DOMDocument parsing
Hello, I am parsing an xml file from an API which I have converted into a DOMDocument in php. This i

PHP Search Issue
Hi, I am using the following code to search and return flights from a database. The user searches by

Am i doing this wrong?
Im pulling from an Oracle database some info... one of which is a field count_pnums which is a NUMBE

eregi to preg
Im converting my regex for php 5.3 and I am stuck on the following

Code: [Select]if((eregi(&q

Retrieving the 25 most recently added entries from all tables in a MySQL databas
Hello,

The code below works great. It creates a table that shows the 25 most recently added t

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash