I have a sql table containing
id - query - query name
the first page contains a drop down menu of all the query names. When chosen the user is sent to a page that prints the result of the query in a html table.
Now i nees to find how many rows the table should have.
This counts how many rows i need in the table:
$parts=explode(' FROM ',$query);
$count=explode(",", $parts[0]);
$result=count($count);
But the problem is that here i explode by commas but the query also contains commas like this: substring (***,19,10) as Part1
My question is how do i count only commas outside these parenteses.
something like this:
$var=0;
start counting commas in parts[0],
when ( accures increase $var to 1,
if $var = 1 dont count commas,
but when ) accures set $var to 0,
and start counting again
The reason why im making it this way is that it's suppose to be possible to just add a query to the sql table no matter how many rows this query needs in output.
Any ideas?
empty() error
Why doesCode: empty($USER_ID = $_SESSION["USER_ID"])create this error...Parse error: syntax error, unexpected '=', expecting ')' in /home3/finestto/public_html/index.php on line 17
Material xxx does not exist in plant xxx
Dear All,
Sending a hyperlink through mail
HI all,
iterating through an array and escape each value independently.
I have a set up where the variable being escaped is an array and it needs to be iterated and escaped by separate. I need some help.Code: <?php$arrFoodTypes =
Sorting JTable on more than just the values listed in the columns
I have a collection of objects that store (among other things) two integer values. I only want to display one of these values. The displayed value will dictate the sort order of the JTable.However, I
my two tables
table1 : col1 = topicid , col2 = topictable2 : col1 = sentid, col2 = sentenceCode: require_once("includes/connection.php"); $trends = mysql_query("SELECT topicid, topic FROM
reading partial code from external site
Hi,I am trying to write a script for my website to get an article from an external website. The external website has the article in a set of tags <roottag> &
is this the proper use of mysql_real_escape_string() to prevent sql injections?
i was wondering is this the proper use of mysql_real_escape_string() to prevent sql injections? any help greatly appreciated. thanks. derekCode:
close site for maintenance
i get a tutorial, saying the following code can put our site offline, and only the developer can view the siteCode: [Select]RewriteEngine OnRewriteBase /RewriteCond %{REMOTE_ADDR}
Kill a process
I have a question - how can I kill a process from a command line or by using Oracle SQL Developer? I have hard time contacting our DB and I would like to be able to kill the process myself, whithout