Jump to content

Imperialdata

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Imperialdata's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hope this is the right section to ask this. I need to hide the message body on a post in a phpbb forum and enable it for certain users only. How is the best way to achieve this? The only mods that exist are for hiding complete forums and not individual topics, even then it is only the message body that I need to hide, not the topic title. Hope someone can help, thanks in advance.
  2. I have a database which I would like to do the following: In table_userinfo I have columns user_id and user_credits. I wish to add 50 to the number stored in user_credits for a single user (say user_id=5) via a php script How is this best achieved? I have succeeded in retrieving the data from the field using return mysql_fetch_array($res,MYSQL_ASSOC); but I am struggling to add 50 to it and drop it back into the table. Thanks in advance ---------------------------------------------------------- [a href=\"http://www.TheBikeForum.com\" target=\"_blank\"]Like Motorcycles?[/a] ----------------------------------------------------------
  3. Title says it all really. I am reading in a 4 column tab delimited file saved from MS Excel. It trips up when it reads the last column (description). It is all going fine until the description text has an apostrophe, where my php code gives the error: 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 't treat it as such" ')' at line 1 The phrase being imported is "didn't treat it as such" Here's my php code: [code]   $fcontents = file ('startup.txt');   for($i=0; $i<sizeof($fcontents); $i++) {       $line = trim($fcontents[$i], '\t');       $arr = explode("\t", $line);            $sql = "insert into startup values ('".                   implode("','", $arr) ."')";       mysql_query($sql);       echo $sql ."<br>\n";       if(mysql_error()) {          echo mysql_error() ."<br>\n";       } } ?> [/code] The MySQL database has 4 cols, all are VARCHAR. I have tried changing the problem column to TEXT with the same error. Thanks in advance
×
×
  • 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.