vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   unexpected $end -- Please Help (https://vborg.vbsupport.ru/showthread.php?t=154191)

Pc 1203 08-03-2007 01:15 PM

unexpected $end -- Please Help
 
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:
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 01:17 PM

PHP 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');
?>

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 01: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:
PHP Code:

$update $vbulletin->db->query("UPDATE userfield SET field7 ='" $data "' WHERE userid =" $userid); 


Opserty 08-03-2007 01: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 01: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_


All times are GMT. The time now is 11:06 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01872 seconds
  • Memory Usage 1,720KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete