Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 09-10-2006, 10:35 PM
NitroSimSev NitroSimSev is offline
 
Join Date: Nov 2001
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Any Idea on how to to get this string to work?

$shouttext = "RACE UPDATE:" . $race ." at " . $qualtime ." on " .$qualdate;
Reply With Quote
  #2  
Old 09-11-2006, 05:39 AM
Mitch100degrees Mitch100degrees is offline
 
Join Date: Feb 2006
Location: Michigan
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by NitroSimSev
$shouttext = "RACE UPDATE:" . $race ." at " . $qualtime ." on " .$qualdate;
PHP Code:
$shouttext "RACE UPDATE: " $race " at " $qualtime " on " $qualdate ""
Reply With Quote
  #3  
Old 09-11-2006, 05:49 AM
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
Posts: 2,528
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Double quotes parse variables... no need to concatenate them.
PHP Code:
$shouttext "RACE UPDATE: $race at $qualtime on $qualdate"
Reply With Quote
  #4  
Old 09-11-2006, 12:53 PM
NitroSimSev NitroSimSev is offline
 
Join Date: Nov 2001
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.")"); 
Reply With Quote
  #5  
Old 09-12-2006, 07:50 PM
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
Posts: 2,528
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 "
    )
"
); 
Reply With Quote
  #6  
Old 09-13-2006, 05:21 PM
NitroSimSev NitroSimSev is offline
 
Join Date: Nov 2001
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:03 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.08532 seconds
  • Memory Usage 2,219KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (4)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete