Jump to content

gristoi

Members
  • Posts

    840
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by gristoi

  1. you can only have it in Descending or Ascending - not both

    cool thanks

    hmm cant even make it ascending order :o

    	$squery = "Select * from Events WHERE EventType like '%seminar%' AND Date > NOW() ORDER BY Date ASC DESC LIMIT 3 ";
    

     

  2. try:

    class test1
    {
    protected $_index;
    
        public function __construct($index)
        {
        $this->_index = $index;
        }
    
    
    }
    
    class test2 extends test1
    {
    
        public function output()
        {
        echo $this->_index;
        }
    
    }
    
    

  3. If you look at gizmola's last message he advised you that the result returns an associative array.

     

    What this means is that the data returned from the server is like this:

    Array('tmap'=> 1, 'field2'=> something ...........

    So when you are trying

    $row=1

    you are not accessing what you need from the array. Try

    if ($row['tmap']==1)

  4. You might want to use a switch statement. It has the same effect as elseif, but easier syntax to follow:

    switch(tmap)
              {
                Case 0: echo 'selected 0';
                            Break;
                Case 1: echo 'selected 1';
                            Break;
                Default: echo 'no tmap selected';
                            Break;

     

    Just remember that you should always use break after each switch statement otherwise the code will continue executing .

  5. Without seeing how you have written your code I can only guess that you haven't wrapped your code properly .

    What you need to do is point your form to a processing page ie:

    <form action=process.php method="post">

     

    Which will send the form to a process.php page. On this page u can capture the form :

    If($_POST['Submit']{ // process form then redirect back to a page}

    please note that this is a very raw example and u shouldn't use $_post['submit'] . But should give the submit button a unique name. ( and well done for researching the issue and giving it a go first :) )

  6. Have you at least attempted to do this yourself? Do you have any tables and a database connection set up. If not then a good place to start is to read up on  some basic mysql and php tutorials and at least have a go yourself first.

     

    If you have attempted to do this yourself then please post the table structures along with the issues are are having

  7. Ok, this can be a right pain to get to the bottom of. A few simple things that you can easily overlook.

    1. Are you following a namespace convention. Ie your index controller in the base module looks like :

    Class Base_IndexController extends .......

    2. The names match identically, if foldername is base then class name should start with lowercase b.

     

    I know it's really simple stuff, but the easiest problem to solve can sometimes be overlooked. I can't tell you how Many times I have come unstuck because I have accidently added a capital into one of my filenames / class names when I shouldn't off

     

  8. couple of things, I have my modules folder within the application folder, have you added :

     

    resources.modules=''
    resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"

    into your application.ini. I had the same issue when i started trying to add modules and this sorted it

  9. Hi, try moving the starting counts out of the loop

     

    <?php
    $count= $_GET['seatco'];
    $adult= 0;
    $child= 0;
    $concession = 0;
    
    for ($i=1; $i<=$count; $i++)
    {
    
    $ticket = $_POST['tick_com'.$i];
    
    echo "tickets: ".$ticket;
    echo "<br>";
    
    if ($ticket =="adult") {
            $adult++;
    }
        elseif($ticket == "child"){
           $child++;
        }
        elseif($ticket =="concession"){
            $conc++;
    }
    else{ 
    echo "no";}
    }
    }
    echo "Adult".$adult;
    echo "Child".$child;
    echo "Concession".$conc;

×
×
  • 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.