PDA

View Full Version : unexpected $end -- Please Help


Pc 1203
08-03-2007, 02:15 PM
Hi All,
I was testing some of my code and I got an unexpected error. It is:

Parse error: syntax error, unexpected $end in /home/penguink/public_html/dev/profilesys/update.php on line 9

And here is my code:
<?php
$data = $_POST['theme'];
$userid = $_POST['uid'];
$update = $vbulletin->db->query("UPDATE userfield SET field7 ='" . $data . "' WHERE userid =" . $userid . ");
include ('/home/penguink/public_html/members/header.php');
include ('/home/penguink/public_html/members/nav.php');
print <b><center>Settings Sucessfully Saved!</center></b>;
include ('/home/penguink/public_html/members/footer.php');
?>

Any help?
- Pc1203

ALSO: This is development code.

Opserty
08-03-2007, 02:17 PM
<?php
$data = $_POST['theme'];
$userid = $_POST['uid'];
$update = $vbulletin->db->query("UPDATE userfield SET field7 ='" . $data . "' WHERE userid =" . $userid . ");
include ('/home/penguink/public_html/members/header.php');
include ('/home/penguink/public_html/members/nav.php');
print <b><center>Settings Sucessfully Saved!</center></b>;
include ('/home/penguink/public_html/members/footer.php');
?>


If you used [ PHP ] tags you would have spotted the error :p

In the query you don't need the . " before the closing bracket

Pc 1203
08-03-2007, 02:20 PM
Ok, Thanks. lol XD

- Pc1203

EDIT: Now i'm getting:

Fatal error: Call to a member function query() on a non-object in /home/penguink/public_html/dev/profilesys/update.php on line 4

And line 4 is: $update = $vbulletin->db->query("UPDATE userfield SET field7 ='" . $data . "' WHERE userid =" . $userid);

Opserty
08-03-2007, 02:39 PM
I don't know if you can use query() maybe use query_write() instead. Also you have included vBulletin's global.php?

Pc 1203
08-03-2007, 02:46 PM
XD. I forgot the global.php. Thanks! Anyway I included it and I get a database error. Here it is:

>> Removed <<

- Pc1203

EDIT: Fixed! I forgot that the userfield table has a prefix of vB_