Jump to content

budimir

Members
  • Posts

    522
  • Joined

  • Last visited

Posts posted by budimir

  1. Hey ther,

     

    Actually using ODBC driver is very easy. First of all, you need to select odbc driver and create an odbc connection. You go to Control Panel, click on Administration tools, then click on Data Sources (ODBC). When the window opens up, click on a tab called System DSN. Click on ADD, select Driver to MS Access. When the second window opens up put a name in "Data source name" (this is the name which you will use for calling the connection for the ODBC driver), click on SELECT and choose where your Access database resides. After that click on OK and you are set to go.

     

    Now, create a PHP script and put in a connection line like this:

     

    $cx=odbc_pconnect("Data_source_name","","","");

     

    And after this, you handle it like normal PHP + MySQL code. Of course the code is a little bit diferent, but there is a lot information about this on the web.

     

    Here is a sample of query:

     

    $cur=odbc_exec($cx,"select Oznaka,Naziv,JedinicaMjere,Pak,TarifnaSkupina,Dobavljac,Klasa,Vrsta,MinKol,MaxKol,OptKol,Cijena1,Cijena2, AVal,ACijena3,ACijena4,AVal2,ASkSmj,Altsifra,ARab,AdrPor,Barcode from TblArtikli");

     

    I hope you got an idea. How to work with it. This is very basic.

  2. if you posted your database structure it would be much easier.

     

    But basicly you could do:

     

    $sql = "SELECT * FROM table_name WHERE id='$id' ORDER BY date DESC";

     

    So this would be the last date when the change was made for that ID. And then you could do the check to see when was last change was done and send an email.

     

  3. Yup, that's right!

     

    But I'm deleting all the records from database where I had no activites for Last 7 days. That's how I'm keeping the database clean. Also a lot of my users are putting things in the basket through the week, so this proved to be the perfect way. At least in my case.

     

    Again, it depeneds on the purpose!

  4. Cheers guys, what would be the best way? store the items so when the user returns to the site the are still in the cart do you think?

     

    cheers

     

    Graham

     

    Maybe that would be the best way. But it depends on what are your needs. I have developed an e-commerce where I'm leaving everything in the basket until checkout, so user has some time to think through if that is the complete order and when he want's to send it.

  5. Hosting service!

     

    By the question you are asking here, I would say you don't have a clue what are talking about. If you don't which software to use to run a server, how the hell are you going to protect the data from the sites you're going to host?

     

    Think it through!

  6. I think the problem is with your php.ini settings.

     

    Try setting max_execution_time = 1 000 000 000

                    max_input_time = 6 000 000 000

                    memory_limit = 800 M

                   

    I had the same problem and this solved it. Try it out. And you must restart Apache after making these changes, otherwise it doesn't matter.

     

    Good luck

  7. Do it like this

     

    1. Create a form (method post) call a file like continue.php

    2. Put two checkboxes

    3. Put one submit button

    4. One checkbox can be called I agree and value="I Agree"

    5. Second checkbox can be called No and value="No"

    6. Put some code in continue.php like:

    if ($checked == I agree){
    header("Location:somepage.php");
    } else {
    header ("Location: #");
    }

     

    The code is not completly done for you. Try to play a little bit. I gave a hint how to do it.

  8. $sql = "SELECT * FROM comments WHERE id = '$id'";
             $query = mysql_query($sql);
             $num_rows = mysql_num_ros($query); [color=red][font=Verdana]//Here is numrows now, but you didn't have it before, so I don't see how are you getting an error from this file when you are not using mysql_num_rows. You are probably getting error message from another file[/font][/color]
    
          $site['url'] = 'http://mesquitechristmas.com/local/display.php?id=$id';
          
          $PageNav = swPagination( $Sql, $MRPP = $limit, $UriAdd = $site['url'], $SortByAllow = FALSE, $SortOrderSeed = FALSE );
          $result = $PageNav['RowList']; #Don't think you need the stuff above
    
          IF ( !$PageNav['TotalRes'] )  echo("Nothing to Display!");
            $i = 0;
             while ($row = mysql_fetch_array ($result)) {
                $color = ($i%2== 0 || $i == 0)?'#DDDDDD':'#EEEEEE';
                $id[$i] = $row["id"];
                $firstname[$i] = $row["firstname"];
                $location[$i] = $row["location"];
                $comment_date[$i] = $row["comment_date"];
                $comment[$i] = $row["comment"];
    
    
    print"<tr bgcolor='".$color."'>
        <td align='left' width='120'><strong> Name</strong>: $firstname[$i]</td>
        <td align='left' width='120'><strong> Location</strong>: $location[$i]</td>
        <td align='left' width='216'><strong> Date</strong>: $comment_date[$i]</td>
      </tr>
      <tr bgcolor='".$color."'>
        <td class='commentBorder' colspan='4'><strong> Comment</strong>: $comment[$i]</td>
      </tr>";
          ++$i;
             }
          }
       }
        ECHO $PageNav['HrefNav'];
    }
    
    // end code for displaying comments 

     

    Can you send me both of this files on my mail? So I can check them out. We are obivously missing something out!

  9. Thanks, nafetski, for your response. I appreciate your time.

     

    Let me clarify, again. I know how to echo information into a table. I can echo one field in one <td>, I can echo two fields in two <td>s. What I want to do is echo one field and have the output split into two <td>s. I dont want one looooong column, I want two columns, that are evenly distributed with clients' names.

     

    I have a db table that has multiple fields BUT I want to list ONLY the clients' names (a SINGLE field in my table) and I would like to echo it so it shows up in two tables on the web page.

     

    List all the clients (ONLY), in two columns on the webpage.

     

    Does that clarify what I'm asking?

     

    Hey superdude,

     

    Try this peace of code, it will in 2 columns:

     

    echo "<table cellspacing=7 border=0 cellpadding=3><tr valign=bottom>";
    $i=1;
    while ($row = mysql_fetch_array($rezultat)){
    echo "<td align=center width='25%' valign=top>";
    if ($row["imgdata"])
    	echo "<a href='images/".$row["imgdata"]."'><img border=0 src='images/".$row["imgdata"]."' alt='".$row["title"]."' witdh='100' height='100'><br><div style='font-size:1px; margin-top:4px;'> </div><a href='images/".$row["imgdata"]."'>";
    echo $row["title"];
    echo "</td>";
    if ($i%2==0) echo "</tr><tr><td> </td></tr><tr valign=bottom>"; // If you put instead 2 number 4 you will get 4 columns
    $i++;
    }
    echo "</tr></table>";

     

    Let me know if that is what you wanted!

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