Thread: mysql query.
View Single Post
  #9  
Old 08-27-2002, 03:42 PM
Vinney Vinney is offline
 
Join Date: Nov 2001
Posts: 68
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Cheers NDLR .....but i cant get it to work, i get this error :

Database error in vBulletin 2.2.6:

Invalid SQL: SELECT field5,field9 WHERE userid='1'
mysql error: You have an error in your SQL syntax near 'WHERE userid='1'' at line 1

mysql error number: 1064

Date: Tuesday 27th of August 2002 05:49:54 PM
Script: http://www.peugeot-gti.net/files/helpdesk/

where do i place your code in the following ? :-

PHP Code:
<?php
<?php
error_reporting
(7);
require (
'../../mainfile.php');
$index 1;
global 
$Pmenu,$breadcrumb;
$Pmenu="";
$breadcrumb="Contact Helpdesk";
$defaultmessage "Dear Helpdesk... \n\n - $bbuserinfo[username]";
$defaultemail "$bbuserinfo[email]";
include(
"header.php");
if (
$bbuserinfo[usergroupid]==||  $bbuserinfo[usergroupid]==|| $bbuserinfo[usergroupid]==|| $bbuserinfo[usergroupid]==11) {
eval(
"dooutput(\"".gettemplate('helpdesk_nologin')."\");"); 
} else {
$customfield=$DB_site->query("SELECT field5,field9 WHERE userid='$bbuserinfo[userid]'");
while (
$field=$DB_site->fetch_array($customfield)) {
     
$field5=$feild[5];
     
$feild9=$field[9];
eval(
"\$usercustomfield = \"".gettemplate('helpdesk')."\";");
}
include(
"footer.php");
}
?>
my helpdesk template contains :

Code:
<table cellpadding="0" cellspacing="0" border="0" bgcolor="#0A293E"  width="95%" align="center"><tr><td>
<table cellpadding="4" cellspacing="1" border="0"  width="100%">
<tr>
<td colspan="2" bgcolor="#336D95" background="https://vborg.vbsupport.ru/images/catagory_backing.gif" align="left"><normalfont color="#000000"><b>
Welcome to PGAC Helpdesk - Follow instructions carefully.</b></normalfont></td>
</tr>
<tr>
<td bgcolor="#13486D" align="left" valign="top">
<p align="center">
<normalfont>Welcome to $bbtitle Helpdesk. </normalfont></p>
<p>
<normalfont>Please take the time to carefully read the following instructions.
This e-mail form has been created, so that forum members can place their questions, or 
queries to a member of our help desk.
Please make sure you fill in all the mandatory fields in.<br><br>
If you have recently just joined the club and have received you membership 
number and renewal date via the post, make sure you have placed them details 
within your
<a target="_blank" href="http://www.peugeot-gti.net/forums/member.php?s=$session[sessionhash]&action=editprofile">
UserCP</a> (<a target="_blank" href="http://www.peugeot-gti.net/forums/member.php?s=$session[sessionhash]&action=editprofile">User Control Panel</a>), and then continue with this.<br>
<br>
-$bbtitle Staff</normalfont></td>
</tr>
</table>
</td></tr></table>
<form enctype="multipart/form-data" action="send.php" name="refer" method="post">
<table cellpadding="0" cellspacing="0" border="0" bgcolor="#0A293E"  width="95%" align="center"><tr><td>
<table cellpadding="4" cellspacing="1" border="0"  width="100%">
<tr>
<td colspan="3" bgcolor="#336D95" background="https://vborg.vbsupport.ru/images/catagory_backing.gif" align="left"><normalfont color="#000000"><b>Contact $bbtitle 
Helpdesk!</b></normalfont></td>
</tr>
<tr>
<td bgcolor="#13486D" align="left" valign="top" nowrap><normalfont>Your 
username:</normalfont></td>
<td bgcolor="#13486D" align="left"><input type="text" name="name" size="30" class="bginput" tabindex="1" value="$bbuserinfo[username]"></td>
<td bgcolor="#13486D" align="left"><b><font color="#FF0000">
*</font></b></td>
</tr>
<tr>
<td bgcolor="#1C5780" align="left" valign="top" nowrap><normalfont>Your email:</normalfont></td>
<td bgcolor="#1C5780" align="left"><input type="text" name="email" size="30" class="bginput" tabindex="1" value="$defaultemail"> </td>
<td bgcolor="#1C5780" align="left"><b>
<font color="#FF0000">*</font></b></td>
</tr>
<tr>
<td bgcolor="#13486D" align="left" valign="top" nowrap><normalfont>Your 
m/ship N</normalfont><normalfont><font face="Times New Roman">?</font></normalfont><normalfont>:</normalfont></td>
<td bgcolor="#13486D" align="left">
<input type="text" name="mem" size="4" class="bginput" tabindex="1" value="$field5"></td>
<td bgcolor="#13486D" align="left"><b><font color="#FF0000">
*</font></b></td>
</tr>
<tr>
<td bgcolor="#1C5780" align="left" valign="top" nowrap><normalfont>Your 
renewal date:</normalfont></td>
<td bgcolor="#1C5780" align="left">
<input type="text" name="expiry" size="8" class="bginput" tabindex="1" value="$field9"> example: 
08/12/02</td>
<td bgcolor="#1C5780" align="left"><b>
<font color="#FF0000">*</font></b></td>
</tr>
<tr>
<td bgcolor="#13486D" align="left" valign="top" nowrap><normalfont>Subject:</normalfont></td>
<td bgcolor="#13486D" align="left">
<normalfont><input type="radio" name="title" value="General Feedback" checked>General Feedback<br>
<input type="radio" name="title" value="Bug Report">Bug Report<br>
<input type="radio" name="title" value="Registration Problem">Registration Problem 
/ Activation request (<b><font color="#FF0000"><u>read above</u></font></b>)<br>
<input type="radio" name="title" value="">Other <input type="text" name="otitle" size="25" class="bginput" tabindex="5">
</normalfont>
</td>
<td bgcolor="#13486D" align="left">
<b><font color="#FF0000">*</font></b></td>
</tr>
<tr>
<td bgcolor="#1C5780" align="left" valign="top" nowrap><normalfont>Your message to us:</normalfont></td>
<td bgcolor="#1C5780" align="left">
<textarea name="message" wrap="virtual" cols="70" rows="15" class="bginput" tabindex="6">$defaultmessage</textarea></td>
<td bgcolor="#1C5780" align="left">
<b><font color="#FF0000">*</font></b></td>
</tr>
</table>
</td></tr></table>
<center>
<b><font color="#FF0000">* </font>= Mandatory field</b><br><br>
<input type="submit" value="Send Email" tabindex="7" accesskey="s" class="bginput"></center>
</form>
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01223 seconds
  • Memory Usage 1,824KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code
  • (1)bbcode_php
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete