Results 1 to 4 of 4

Thread: Why doesn't this Boolean work?

Threaded View

  1. #1

    Thread Starter
    Frenzied Member Jmacp's Avatar
    Join Date
    Jul 2003
    Location
    UK
    Posts
    1,959

    Why doesn't this Boolean work?

    I have never had a boolean work in php although i havet only tinkered.

    I am putting 8 records filled with html into a mysql table, w1----w8 .

    When the webpage loads i only need retrieve the first record (w1) and then echo it, the others(w2--w8) are controlled by the <form method = "post" dependng if values are posted or not. So if values are posted then (w2---w8) are echo'ed. w1 contains the header html with the css link for the webpage hence it sets the main layout. Whereas w2----w8 are a noticeboard (or forum) like where values are being appended into the page.

    So i though i'd use a Boolean to make the first record only display once, i.e when the page loads at first, i tried this (but this doesn't work, every time i "<form post" w1 still gets echo'ed.......?

    PHP Code:
    if ($foo == True) {

    mysql_select_db("webinfo"$con);

    $sql="SELECT w1 FROM webdata";

    if (
    $result=mysql_query($sql)) {

     
    $foo False;

     echo 
    $result;


      } 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width