Jump to content

insaynewrapper

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

About insaynewrapper

  • Birthday 09/09/1988

Contact Methods

  • Website URL
    http://www.myspace.com/thebritishkid

Profile Information

  • Gender
    Not Telling

insaynewrapper's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. And I understand that, but I don't see how it's any more organized than not using them. Maybe you could give me an example...?
  2. I'm a pretty decent PHP developer, but I have yet to implement classes in my work, and I'll tell you why: I've never had a need to. I just plain and simple don't understand the need for oop when I'm working. I don't see the advantage of using it. What can I do through oop that I can't do otherwise? Thoughts?
  3. Yeah. You need the GD library to work with images.
  4. [code]doQuery(sprintf("UPDATE `forum_threads` SET `subject`='%s' AND `text`='%s' WHERE `id`='%s' LIMIT 1", $threadSubject, $threadText, $threadid));[/code] It looks fine to me. When I insert something with that it inserts fine, and everything is fine. But when I go to edit it, it changes the subject to '0' no matter what you try to set it as. I've determined that it is something in this line that does it.. The code to doQuery is [code]function doQuery($query) {     $query = mysql_query($query .';') or die($dieMessage . "\n<br />". mysql_errno() .': '. mysql_error() .'</p>');     return $query; }[/code]
  5. Well sanitize is supposed to add slashes and such, but right now it doesn't do anything. It just returns back the string.
  6. In the site I'm currently working on I'm having a reoccuring problem where for some reason a particular variable just likes to change itself to '0'. Here's one instance of the code.. [code]if($_POST['submit'] == "Update") {     $realname = sanitize($_POST['realname']);     if($realname)     {         if(strlen($realname) > 64)         {             doMessage('Your real name must be less than 64 characters.');         }     }     if(strlen($_SESSION['message']) == 0)     {         doQuery("UPDATE `members` SET `realname`='$realname' AND `gender`='$gender' AND `location`='$location' AND `birthday`='$birthday' AND `email`='$email' AND `about`='$about' AND `forumavatar`='$forumavatar' WHERE `username`='". $userInfo['username'] ."'");     } }[/code] The doQuery function is nothing but [code]function doQuery($query) {     $query = mysql_query($query .';') or die($dieMessage . "\n<br />". mysql_errno() .': '. mysql_error() .'</p>');     return $query; }[/code] And the doMessage is just [code]function doMessage($messageStr, $class="error") {     if($_SESSION['message']) {$_SESSION['message'] .= "\n<br />";}     $_SESSION['message'] .= '<span class="$class">'. $messageStr .'</span>'; }[/code] Everything else will insert itself in the database fine, but for some reason 'realname' will change itself to 0. I cannot figure out why. I left out big chunks of code from the first part, but nothing I would think worth posting.. If anybody can figure out what I'm doing wrong I would greatly appreciate it. I've exhausted myself for over a month now trying to figure out what the deal is. Thanks alot! Daniel
×
×
  • 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.