Jump to content

Jessica

Staff Alumni
  • Posts

    8,968
  • Joined

  • Last visited

  • Days Won

    41

Everything posted by Jessica

  1. lol - if ($errorcheck = TRUE) = sets it true. == is the comparison.
  2. Jessica

    ERROR?

    omg! It's probably a surrounding line. Post some of the code around there. Also, using an editor with syntax highlighting helps catch those.
  3. $row only exists in the constructor, and is never saved as $this->row. What you should do is have a var $forename; then in the constructor add $this->forename = $row['Forename']; and in Get_Name() return $this->forename.
  4. try adding trim($name) and then checking the strlen($name) > 0
  5. Then the problem might be elsewhere. Where is $page1 defined? As I asked before, what does Rate() do? Are you getting any errors?
  6. Uhm, did you try what I posted?
  7. Still shouldn't cause a problem. I dunno.
  8. I don't think so, since it's not working with the directory. From what the manual says, glob isn't the right function to use here. I think explode was fine, but the problem is getting it into the array, which if he tries the code I posted, I think I fixed that.
  9. So it wasn't that before? What was it when the problem started?
  10. [quote author=ted_chou12 link=topic=123506.msg510547#msg510547 date=1169479801] dont you know that php code starts with 0? and from the code above you can clearly see that 8 is in line 5, or is it the problem with your eyesight? [/quote] ORLY? PHP STARTZ AT ZEROES? OMG! Yes, ID 8 is line 5. But as you yourself said, "therefore, the code will return 4 for line 5." Where the hell are you getting a four? Maybe if you would explain things in a way that made sense, you'd get more help. Did you TRY the flipping code I posted? [code] <?php $array = file("posts.txt"); foreach ($array as $line) {   $data = explode("#", $line);   $array1[$data[0]] = $data[1]; } foreach ($array1 as $line2) {   echo $line2;echo "<br>"; } print_r($array1); ?> [/code]
  11. That's a huge honking int. Dunno, best of luck.
  12. So if the user searches for "foo" and there is an entry: My name is foo It should show up as My name is <strong>foo</strong> And if there is an entry My <a href="foo.com">name</a> is foo It should show My <a href="foo.com">name</a> is <strong>foo</strong> But what you get is My <a href="<strong>foo</strong>.com">name</a> is <strong>foo</strong>. Hm. If I understood that right, this seems complicated.
  13. "what I want to do is when i give id 8, for example, and i wnat to get the line number of id 8: therefore, the code will return 4 for line 5." You want the line number for line 5 but it should return 4? the 4 on there is line 3, line 5 is 8. If you understood that perfectly, that explains why you're having trouble with your code. Try the bit I wrote.
  14. AFAIK that's not a field type. Is it an int? smallint, tinyint, what?
  15. What does Rate() do? This should be close, depending on what Rate() is for. [code]for($i=1; $i<=10; $i++){   echo '<option value="http://www.randomhomepage.co.uk/homepages/files/rate.php?id='.$id.'&rate='.$i.'">'.$i.'</option>';   Rate($page1, $i); }[/code]
  16. What you just said makes no sense. As always. Good luck.
  17. So you want to put each line into an array? I think you want $array1[$data[0]] = $data[1];
  18. Yeah I'm confused too. I corrected the syntax, but I don't get what you're trying to do.
  19. What is the field type of the primary key?
  20. Oh right, just do =, I read too quickly. => is for when inside of the array() constructor. So I think you want $array1[] = array($data[0]=>$data[1]);
  21. Just on first glance I'd say the int(15) is too small. Make it a bigint or something higher. Sounds like you're out of range. Is the int(15) unsigned as well?
  22. It would be $data[0]=>$data[1]; No string stuff.
×
×
  • 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.