Jump to content

SacredProductions

Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

SacredProductions's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I am using this simple query to update the order of some articles on a webpage. [tt] $sql="UPDATE articles_level0 SET order='$norder' WHERE id='$id'"; mysql_query($sql) or die(mysql_error());[/tt] I get this error- [tt]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 'order='1' WHERE id='9'' at line 1 [/tt] The numbers for order and id are correct. I cannot find the syntax error though. Any help is appreciated
  2. I think you should try to escape it with the ASCII version of the apostrophe, which is [code] & # 3 9; [/code] (omit the spaces, I had to put them there so the forum could read it [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /] ) I had the same problem as you and this worked for me. Hope this helped, Ben
  3. Umm.. not quite sure why.. but for some reason it has now decided to work. I didnt change anything.. perhaps there was a problem with.. umm... [img src=\"style_emoticons/[#EMO_DIR#]/huh.gif\" style=\"vertical-align:middle\" emoid=\":huh:\" border=\"0\" alt=\"huh.gif\" /] Anyways, thank you all for your effort. -Ben
  4. [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]okay hows about removing this red part: while ($gbarray = mysql_fetch_array($result,$conn)){ [/quote] Yes, I did realize that was an issue shortly before you posted, but that still did not remedy the problem. [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Then clearly there's a problem with the querystring in the live version. $sql="SELECT * FROM guestbook ORDER BY id DESC"; [/quote] Still nothing :(
  5. Thank you for your reply Crayon, I did run some tests, - I echo'd the number of rows being returned which came out as 2, which is correct. - I also echo'd the variables, $name, $email, and $message, yet nothing was returned. - Then I set up the code on a different page, seperate from anything else and the variables still returned blank, which shows that the problem lies in the bit of code I posted The textbox() function is just setting up the tables with a header (the first argument) and the content (the second argument). This part is working as the textboxes are showing up, along with the " - " in the header. What remains unkown is why the variables are not storing anything. Again, any help is appreciated- Ben
  6. This is a bit of code im using to get the posts for a guestbook out of a database. [code] $sql="SELECT * FROM guestbook ORDER BY id desc;"; $result=mysql_query($sql,$conn) or die(mysql_error()); while ($gbarray = mysql_fetch_array($result,$conn)){     $name=$gbarray['name'];     $email=$gbarray['email'];     $message=$gbarray['message'];     textbox("$name - $email","$message"); } [/code] Im not getting any "official" errors.. however, the variables are not storing anything and are showing up as blank spaces on the webpage. I've used this method many times, and yet for some reason this time its not working. I triple checked the naming.. everything. It seems perhaps there may be something throwing it off somewhere else in the document? I dont think so.. *sigh*. Is there a better way to do this? Any help is appreciated, -Ben
  7. Is there a way to limit the number of rows simply by specifying the number of the row? What would be the code to display rows such as - 10 through 20, or rows 30 through 40? Thanks for any help! - Ben
×
×
  • 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.