Nested repeat region and mysql error
Posted: 2013-04-24 14:31
Hi all,
I created a nested repeat region using the ADDT.
It works great until the script encounters a a field containing a quote (').
Here is a sample list:
The only solution I've found is to change the standard quote to something "similar": `
It's not elegant, but it works.
So, what went wrong in the script?
Here the portion of code related to the nested repaet region (I hope you can help me to sort this out):
It seems something related to the quote not being stripped.
But I'm not good programmer and I can't change this code to make it work.
Any suggestion will be really appreciated.
TIA
tony
I created a nested repeat region using the ADDT.
It works great until the script encounters a a field containing a quote (').
Here is a sample list:
Code: Select all
ABRUZZO
- city1
- city2
- city3
BASILICATA
- city4
- city5
- city6
VALLE D'AOSTA
ou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'aosta' ORDER BY PROV ASC, DENOMINAZIONE ASC' at line 1
It's not elegant, but it works.
So, what went wrong in the script?
Here the portion of code related to the nested repaet region (I hope you can help me to sort this out):
Code: Select all
<?php
if ($totalRows_rsreg>0) {
$nested_query_rsnome = str_replace("123456789", $row_rsreg['REGIONE'], $query_rsnome);
mysql_select_db($database_conn_nardi);
$rsnome = mysql_query($nested_query_rsnome, $conn_nardi) or die(mysql_error());
$row_rsnome = mysql_fetch_assoc($rsnome);
$totalRows_rsnome = mysql_num_rows($rsnome);
$nested_sw = false;
if (isset($row_rsnome) && is_array($row_rsnome)) {
do { //Nested repeat
?>
But I'm not good programmer and I can't change this code to make it work.
Any suggestion will be really appreciated.
TIA
tony