vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Any Idea on how to to get this string to work? (https://vborg.vbsupport.ru/showthread.php?t=126282)

NitroSimSev 09-10-2006 10:35 PM

Any Idea on how to to get this string to work?
 
$shouttext = "RACE UPDATE:" . $race ." at " . $qualtime ." on " .$qualdate;

Mitch100degrees 09-11-2006 05:39 AM

Quote:

Originally Posted by NitroSimSev
$shouttext = "RACE UPDATE:" . $race ." at " . $qualtime ." on " .$qualdate;

PHP Code:

$shouttext "RACE UPDATE: " $race " at " $qualtime " on " $qualdate ""


Adrian Schneider 09-11-2006 05:49 AM

Double quotes parse variables... no need to concatenate them.
PHP Code:

$shouttext "RACE UPDATE: $race at $qualtime on $qualdate"


NitroSimSev 09-11-2006 12:53 PM

Interesting I tried that and got a parse error. Will try it again tonight when I get home.

Ok that works accept when I thry to insert it in the db I get a parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/nitrosim/public_html/forums/ladder.php on line 493. Here's the code any suggestions?


PHP Code:

$shouttext "RACE UPDATE: $race at $qualtime on $qualdate"
$user "5799";
$username "Ladder Admin";

$vbulletin->db->query_write("INSERT INTO " TABLE_PREFIX "chatboxlite_shout(userid, username, shout, dateline) VALUES ('".$user."', '".$username"', '".$db->escape_string($shouttext)."', ".TIMENOW.")"); 


Adrian Schneider 09-12-2006 07:50 PM

It's easier to pick out errors if you format things to make them easier to read. You are missing a . after your $username inside the query.
PHP Code:

$shouttext "RACE UPDATE: $race at $qualtime on $qualdate";
$user 5799;
$username 'Ladder Admin';

$db->query_write("
    INSERT INTO " 
TABLE_PREFIX "chatboxlite_shout
        (userid, username, shout, dateline)
    VALUES (
        " 
$user ",
        '" 
$username "',
        '" 
$db->escape_string($shouttext) . "',
        " 
TIMENOW "
    )
"
); 


NitroSimSev 09-13-2006 05:21 PM

ughhhhh....Thanks, I have written 3300 lines of code in the past 2 weeks so my eye are getting tired of looking at code!


All times are GMT. The time now is 10:36 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.01168 seconds
  • Memory Usage 1,733KB
  • 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
  • (4)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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