i have a problem using with single and double quotes with brackets in php
$nestedData[] = '<a href="JavaScript:newPopup('loghistory.php?logid='.$row['user_id'].'')"> History('.$countqry.')</a>';
i have a problem using with single and double quotes with brackets in php
$nestedData[] = '<a href="JavaScript:newPopup('loghistory.php?logid='.$row['user_id'].'')"> History('.$countqry.')</a>';
You need to escape the quotes or concat the strings:
$nestedData[] = '<a href="JavaScript:newPopup('loghistory.php?logid='.$row['user_id'].'')"> History('.$countqry.')</a>';
^ here your string ends
You can change to:
$nestedData[] = '<a href="JavaScript:newPopup(\'loghistory.php?logid='.$row['user_id'].'\')"> History('.$countqry.')</a>';
Or another option:
$nestedData[] = '<a href="JavaScript:newPopup('. "'loghistory.php?logid='" .$row['user_id']. "'" . ')"> History('. $countqry .')</a>';
$nestedData[] = '<a href="JavaScript:newPopup('loghistory.php?logid='.$row['user_id'].'')"> History('.$countqry.')</a>';
try the below code:
<a href="JavaScript:newPopup("loghistory.php?logid='.$row['user_id'].'')"> History('.$countqry.')</a>
If you wish to output a single tick from within a litteral string then you will need to escape that single quote:
$a = 'Graeme\'s example';
echo $a;
Will output:
Graeme's example
$nestedData[] = "<a href=\"JavaScript:newPopup('loghistory.php?logid='".$row['user_id']."')"."\"> History('".$countqry."')</a>";
Escape the quotes with \
this should do the trick
$nestedData[] = '<a href="JavaScript:newPopup('".loghistory.php?logid='".$row['user_id']."'."')"> History("'.$countqry.'")</a>';