vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   MySQL query problem (https://vborg.vbsupport.ru/showthread.php?t=104348)

Delphiprogrammi 01-03-2006 05:41 PM

MySQL query problem
 
hi people,

I'm having a problem with a MySQL query.It's an "install" code for a product and i'm getting an error returned

PHP Code:

$db->query_write("INSERT INTO " TABLE_PREFIX "setting(varname, grouptitle, value, defaultvalue, optioncode, displayorder, advanced, volatile,product) VALUES ('modpmtext', 'posting', 'Hi $username,\r\n\r\nThis message is to advise you  that your $type titled "$threadinfo"  has been $action.\r\n\r\nThe $type is located at this URL $url\r\n\r\nIf you have any questions, you can ask an administrator for assistance\r\n\r\nSincerely,\r\nThe $bbtitle staff.', 'Hi $username,\r\n\r\nThis message is to advise you  that your $type titled "$threadinfo"  has been $action by $modby.\r\n\r\nThe $type is located at this URL $url\r\n\r\nIf you have any questions, you can ask an administrator for assistance\r\n\r\nSincerely,\r\nThe $bbtitle staff.', 'textarea', 150, 0, 0, 'free', 'modautopm') 

unexpected variable is the error returned ..

should i use $db->escape_string() ??

harmor19 01-03-2006 06:01 PM

ytry dleting the quotes sround "$threadinfo" (both of them)

Delphiprogrammi 01-03-2006 06:22 PM

hi,

getting this error ....

Quote:

Parse Error:parse error,unexspected T_CONSTANT_ENCAPSED_STRING in /path to/plugin.php(1239):eval'd code on line 4
probably a " i forgot to close

Reaktor7 01-04-2006 12:21 AM

PHP Code:

$db->query_write("
INSERT INTO " 
TABLE_PREFIX "setting(varname, grouptitle, value, defaultvalue, optioncode, displayorder, advanced, volatile,product) 
VALUES ('modpmtext', 'posting', 'Hi 
$username,\r\n\r\nThis message is to advise you  that your $type titled \"$threadinfo\"  has been $action.\r\n\r\nThe $type is located at this URL $url\r\n\r\nIf you have any questions, you can ask an administrator for assistance\r\n\r\nSincerely,\r\nThe $bbtitle staff.', 'Hi $username,\r\n\r\nThis message is to advise you  that your $type titled \"$threadinfo\"  has been $action by $modby.\r\n\r\nThe $type is located at this URL $url\r\n\r\nIf you have any questions, you can ask an administrator for assistance\r\n\r\nSincerely,\r\nThe $bbtitle staff.', 'textarea', 150, 0, 0, 'free', 'modautopm')"); 


Delphiprogrammi 01-04-2006 06:34 PM

1 Attachment(s)
hi,

it isn't working correctly even with the "\" stuff those variables aren't parsed they don't show up all i see is "" an empty string

hi,

Here you can see what i mean.modpmtextitle should be "your $type $threadinfo has been $action" but it shows "" instead of the variables ?? this an old vb 3 hack i'm trying to port to 3.5.x product working fine except of those parsing trouble

problem solved just insert a "\" (no quotes offcource) before the text starting with $


All times are GMT. The time now is 04:06 PM.

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.01080 seconds
  • Memory Usage 1,729KB
  • 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
  • (2)bbcode_php_printable
  • (1)bbcode_quote_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