Hey guys!

I have an error with the ' and " tags, I can't work out which way they should go..

<?php
$uzivatel = mysql_query("SELECT * FROM ip WHERE ip = '" . $ip . "' LIMIT 1");
while($uzivatele = mysql_fetch_array($uzivatel)){
echo '<center><input type="text" value="' . $stranka . '?id=' . $uzivatele['kod'] .  '" onclick="this.focus(); this.select();" size="33" name="odkaz" class="odkaz"></center>';
?>

Any ideas at all?

Recommended Answers

All 7 Replies

Member Avatar for diafol
<?php
$uzivatel = mysql_query("SELECT * FROM ip WHERE ip = '$ip' LIMIT 1");
while($uzivatele = mysql_fetch_array($uzivatel)){
echo "<center><input type=\"text\" value=\"{$stranka}?id={$uzivatele['kod']}\" onclick=\"this.focus(); this.select();\" size=\"33\" name=\"odkaz\" class=\"odkaz\"></center>";
?>

Still getting the same error...

Shall I post the full file code?

Member Avatar for diafol

it would help. post the error msg too

It's just in that part of the code, whenever I take it out the PHP parses fine.

Here's the error when the code is in:

Parse error: syntax error, unexpected $end in /home/jaygould/public_html/domain.com/trial.php on line 192

Member Avatar for diafol

You have no closing brace (}) at the end of the while loop

that's done it!

thank you so much!

Member Avatar for diafol

ok please mark as solved - the link below - just above the edit box.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.