Jump to content

Tazz

Members
  • Posts

    43
  • Joined

  • Last visited

    Never

Posts posted by Tazz

  1. Ahh... That makes sense!  Thanks for telling me about the fact that I need to make sure my tables are InnoDB, all mine were MyISAM.  I'll play around with it a little bit more, but the way you described it to me now makes perfect sense. Thanks again!

  2. I am new to MySQLI and tried to test the rollback functionality.

     

    I created a simple database called mysqli and one table called test with and id and name field.

     

    my PHP is as follows:

    $mysqli = new mysqli('localhost',name,password,'mysqli');
    
    $mysqli->autocommit(FALSE);
    
    $result = $mysqli->query("INSERT INTO test (name) VALUES('bla')");
    
    $mysqli->commit();
    $mysqli->rollback();
    

     

    After hitting the page, it does the insert, but does not roll back the transaction.  So it ends up being inserted into the DB.  Why is the rollback not working?

  3. The title may be a bit misleading, but essentially what I have is a custom CMS I built in PHP.  What I want to do next is to build some sort of authentication to ensure my code was not copied and reused on another server.

    I need some way to communicate between my CMS and an external script to ensure that it is valid.

     

    I was thinking of putting a file on a domain. A simple function that accepts an url this function takes the url, searches the db, if it finds it, send back an result.

     

    My CMS obviously queries this function with the current url of the domain and if the url is in my db, the software works, otherwise it displays a message saying it was illegally copied.

     

    How do I build this interaction between the two?  I could use AJAX, but i need something a bit more robust so that your average developer doesn't figure it out too easily.

  4. I don't really know how to explain this, I saw once on some forum members signature, something like this :

    G = "\ x50 \ x72 \ 157 \ 144 \ x75 \ x63 \ 164 \ x20 \ x6c \ x69 \ 143 \ 145 \ 156 \ x73 \ 145 \ 040 \ x68 \ 141 \ x73 \ 040 \ x65 \ x78 \ 160 \. 151 \ 162 \ x65 \ 144 \ x2e \ x20 "+ E.

     

    That somehow translates into words, I know there is a PHP function to convert that, what is that code called and what is the PHP function?

  5. Once again I'm stuck with some jquery...

     

    I am trying to implement the table sorter plugin. http://tablesorter.com/docs/

     

    Here is some demo code:

    <!doctype html public "-//w3c//dtd html 3.2 final//en">
    <html>
        <head>
            <title>Table Sorter Test</title>
            <script type="text/javascript" src="jquery.js"></script>
            <script type="text/javascript" src="jquery.tablesorter.js"></script>
            <script type="text/javascript">
                $(function()
                {
                    $("#tablesorter-demo").tablesorter();
                }
            );
            </script>
        </head>
        <body>
            <table id="tablesorter-demo" class="tablesorter" border="0" cellpadding="0" cellspacing="1">
                <thead>
                    <tr>
                        <th>first name</th>
                        <th>last name</th>
                        <th>age</th>
                        <th>total</th>
                        <th>discount</th>
                        <th>difference</th>
                        <th>date</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td>peter</td> <td>parker</td> <td>28</td> <td>$9.99</td> <td>20.9%</td> <td>+12.1</td>
                        <td>jul 6, 2006 8:14 am</td>
                    </tr>
                    <tr>
                        <td>john</td>
                        <td>hood</td>
                        <td>33</td>
                        <td>$19.99</td>
    
                        <td>25%</td>
                        <td>+12</td>
                        <td>dec 10, 2002 5:14 am</td>
                    </tr>
                    <tr>
                        <td>clark</td>
                        <td>kent</td>
                        <td>18</td>
                        <td>$15.89</td>
                        <td>44%</td>
                        <td>-26</td>
                        <td>jan 12, 2003 11:14 am</td>
                    </tr>
                </tbody>
            </table>
        </body>
    </html>
    

     

    The jquery.js file I am referencing in the <head> is the latest jquery 1.3.2 and the tablesorter js file is the minified one downloaded from the url at the top of this post.

     

    For some weird reason I cant get it to work. What am I doing wrong?

  6. Hi

     

    I'm part of the dev team of www.psgkonsult.co.za and we use Jquery UI Cycle for our header images.  As the page loads, you will notice all the header images appearing below each other for a split second before the javascript plugin initializes and the images start rotating.  Is there any way we can preload the plugin or is it the images that need preloading?  How can we avoid the images appearing below each other for that short time before the plugin starts doing its job?

  7. I've figured out a way to redirect any 404 errors to a single controller.  It's probably not the best way, but it works like a charm.

     

    Find system\libraries\Router.php

    If your file is still untouched, the code you want to add will be on line 162

     

    Simply redirect to your 404 error controller.

     

    if (Router::$controller === NULL)
            {
                // No controller was found, so no page can be rendered
                url::redirect(url::site()."notfound");
                exit;
               // Event::run('system.404');
            }

     

    I'm sure you can figure out the rest from here...

  8. I have Googled it, as well as searched on the Kohana forums.  All the code examples assume you know how the framework works inside-out. I am using version 2.3.4.  All I need to know is just the path to the file where I can set a default controller/view for any 404 errors, if such a method exists in Kohana.

  9. Im a Kohana newbie. How and where do you make a custom 404 page for Kohana framework.  I have read a few posts that give code but I am unable to get that going.  Apparently you create a errors.php file in application\hooks\errors.php but its not working.

     

    Where in Kohana do you set a global path to a view for any 404 errors?

  10. Hi vinpkl

     

    The data type doesn't make a difference at all.  I tried making it text, but it made no difference to the output.  So far I have discovered that my query only returns 4099 characters from the database table.  I made up some text with over 6000 characters but it only returns 4099 of those.  I don't limit the query or results anywhere. I am really at my wit's end.

  11. I have a MsSQL query in PHP that is supposed to retrieve HTML from the database to be displayed for a blog.  It cuts off at a certain stage, I don't know why.

     

    Here is my query code:

    function retrieveSpecificEntry($id)
        {
            $sql = "SELECT html FROM Blog WHERE id =".$id;
            $result = mssql_query($sql);
            while ($row = mssql_fetch_array($result))
            {
                $entry_array[] = $row;
            }
    
            return $entry_array;
        }
    

     

    My SQL actually selects '*', that's why I load it all into an array, but for the sake of the forum I just want to show that even selecting just the html field, it still doesnt return all of it.

     

    In my database the html field has a varchar(MAX) data type.

     

    Its a huge blog entry and it cuts off the last two paragraphs for no obvious reason.  After returning the array to the page where the function gets called, I simply echo the contents.  Thats it. No other code.  So why would it cut off some of my HTML?

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