Jump to content

[SOLVED] Query Problem


Hartley

Recommended Posts

This is a segment of a larger script (the actual query involves a total of 43 columns, but I didn't post the whole thing for the sake of space. There is no error in the query, it just doesn't seem to pull.

 

<?php

$dbhosta = 'xxx';
$dbusera = 'xxx';
$dbpassa = 'xxx';
$dbnamea = 'xxx';

$conna = mysql_connect($dbhosta, $dbusera, $dbpassa) or die ('Error connecting to mysql');
mysql_select_db($dbnamea);

$attune = "SELECT cot_intro, arc_key_quest FROM attunement WHERE userid = " .$_COOKIE['bbuserid'];
$attquery = mysql_query($attune);

while($att = mysql_fetch_assoc($attquery))
{
   $cot_intro = $att['cot_intro'];
   $arc_key_quest = $att['arc_key_quest'];

}

if ($cot_intro == "1") {

$cot_intro_1 = "on";
$cot_intro_2 = "off";

}

else {

$cot_intro_1 = "off";
$cot_intro_2 = "on";

}


if ($arc_key_quest == "1") {

$arc_key_quest_1 = "on";
$arc_key_quest_2 = "off";

}

else {

$arc_key_quest_1 = "off";
$arc_key_quest_2 = "on";

}

?>

 

It's not a cookie problem, because even when I give a specific row to pull, it doesn't work. Thanks in advance.

Link to comment
Share on other sites

Worth mentioning as well: this table had a similar problem with nothing working on it in a setup problem I've had. Is there any sort of glitch that may occur from the name? The table attunement seems to not work at all, and the syntax looked fine.

Link to comment
Share on other sites

I forgot to include the mysql_error()! When I did it, I got more details:

 

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ssl, cot_mh FROM attunement WHERE userid = 1' at line 1

 

It was a part I cut out of the code snippet I posted. When I took out the ssl and cot_mh, it worked! However, I can't figure out why it did.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.