Jump to content


Photo

Adding


  • Please log in to reply
2 replies to this topic

#1 korrupt_23

korrupt_23
  • Members
  • PipPip
  • Member
  • 13 posts

Posted 16 November 2003 - 02:46 AM

Hey, I was just wondering the easiet way to add to a column. I\'m attempting to use:

<?include("connect.php");$sql4 = "UPDATE `user_info` SET `user_movie_points` = `user_movie_points+1` WHERE `user_id` = \'$userid\' LIMIT 1;";  	mysql_query($sql4);?>

But it doesn\'t seem to work.

Anyone see anything worng, or can give me a better way? :(
KoRRupt

#2 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,021 posts

Posted 16 November 2003 - 05:59 PM

Nearly there! Just move the backtick (although you only need them if your field name is a reserved word or contains spaces)

[php:1:6aa6cb6f8e]<?php
$sql4 = \"UPDATE `user_info` SET `user_movie_points` = `user_movie_points` + 1 WHERE `user_id` = \'$userid\' LIMIT 1\";
?>[/php:1:6aa6cb6f8e]
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#3 korrupt_23

korrupt_23
  • Members
  • PipPip
  • Member
  • 13 posts

Posted 16 November 2003 - 06:20 PM

Thanks so much man! That stupid litte backtick :x

I love this place, everyone always trys to help, or helps wonderfully! Weee! 8)
KoRRupt




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users