php code problem php code problem
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

php code problem

Started by phill104, June 16, 2007, 11:11:54 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

phill104

I'm trying to do a custom google map thing where users can enter some details in a form, this is then uploaded to a Mysql database. This is for a little google map thing I'm doing to show more details about the coppermine photo they have upload which can then link from the map to the photo.

I had the code working well but suddenly it seemed to go wrong and now I have been staring at it for ages and my eyes are going wonky.

it returns the error

Parse error: parse error, unexpected ';' in /data/members/paid/w/i/windsurf.me.uk/htdocs/www/usermap.php on line 42

here is the code

<?php
$link 
mysql_connect("localhost""********""********") or die("Could not connect: " mysql_error());
mysql_selectdb("windsurf_me_uk_4",$link) or die ("Can\'t use dbmapserver : " mysql_error());

$result mysql_query("SELECT * FROM locations",$link);
if (!
$result)
{
echo 
"no results ";
}
while(
$row mysql_fetch_array($result))
{
echo 
"var point = new GLatLng(" $row['field_10'] . "," $row['field_9'] . ");\n";
echo 
"var marker = createMarker(point, '" addslashes($row['field_2'] . "<br />" $row['field_3'] . "<br />" $row['field_4'] . "<br />" $row['field_4'] . "<br />" $row['field_6'] . "<br />" $row['field_7'] . "<br />" $row['field_8'] . " <br /><a href=\"" $row['field_11'] . "\">" $row['field_11'] . "</a><br/>" $row['field_12'] . "<br />');\n";
echo 
"map.addOverlay(marker);\n";
echo 
"\n";
}

mysql_close($link);
?>


line 42 is the echo "var marker line.

Can any of you see what is going on here?

[Edited by Sami]:
Mysql Username/password Removed as requested
It is a mistake to think you can solve any major problems just with potatoes.

phill104

Could someone edit out the mysql password in my previous post too?
It is a mistake to think you can solve any major problems just with potatoes.

Sami

there is a missing ) here :

addslashes($row['field_2']

:)
‍I don't answer to PM with support question
Please post your issue to related board

phill104

Cheers Sami (on both counts)

I've just got to suss out cpmfetch now and rewrite the form (using the excellent phpformgen http://phpformgen.sourceforge.net, saves all that nasty coding of forms and it's free) and I should be good to go with the finish thing. I'll post it on this site when it's finished.
It is a mistake to think you can solve any major problems just with potatoes.

Sami

‍I don't answer to PM with support question
Please post your issue to related board