Jump to content

J.Daniels

Members
  • Posts

    143
  • Joined

  • Last visited

    Never

Posts posted by J.Daniels

  1. I think the problem is in this line:

     

    26      if (@mysqli_num_rows($r) == 1) { // A match was made.

     

    To check the number of rows returned when using mysqli:

     

    26      if ($r->num_rows == 1) { // A match was made.

     

    Also, that probably didn't throw an error because error suppression was on (The @ before the function call)

     

    EDIT:

     

    After looking through your code more, it appears all the SQL function calls may be through a custom interface.  I would take off the error suppression to see if any errors come up:

     

    26      if (mysqli_num_rows($r) == 1) { // A match was made.

  2. Does your host allow a custom php.ini?

     

    One way to view what settings are loaded is to create a file with:

     

    <?php
    phpinfo();
    ?>
    

     

    View that in your web browser and it will list all the PHP settings.  Look for upload_max_filesize.

  3. Also, you need to specify $this when referencing a class variable:

     

    Class ABC {
    
       static $taken = array();
    
       function setArray() {
    
       // connect and query etc..
       // extract all the mysql and store it in an array of taken urls
    
           while($row = mysql_fetch_array($results)) {
               $this->taken[] = $row['the_url'];
           }
       }
    
       function getArray() {
       // return the array so that a btree can search through them.
           return $this->taken;
       }
    
    }

  4. This may work:

     

    $query_product = "SELECT *, MATCH (prodName,prodBrand,prodCategory) AGAINST (UPPER(".quote_smart($pluspieces).") IN BOOLEAN MODE) AS relevance FROM affiliSt_products1 WHERE MATCH (prodName,prodBrand,prodCategory) AGAINST (UPPER(".quote_smart($pluspieces).") IN BOOLEAN MODE) $extracondition HAVING relevance > 0 $sortby";

  5. $links = "http://site.com<br>
                http://site2.com<br>
                http://site3.com<br>";
    
    $linksArray = explode('<br>', $links);
    $counter = 1;
    $links = '';
    
    foreach ($linksArray as $l) {
        if ($l != '') {
            $links .= $l . '<br> ' . $counter . ' ';
            $counter++;
        }
    }
    echo $links;

     

    You have to reset $links before adding the result.  Also, if you don't want the last blank line, check to see if it is an empty string.

  6. By default, MySQL will perform a natural language search.  To change it to a boolean search, try making these changes:

     

        $pluspieces .= $pieces[$pi].' ';

    to:

        $pluspieces .= '+'.$pieces[$pi].' ';

     

    and

     

    $query_product = "SELECT *, MATCH (prodName,prodBrand,prodCategory) AGAINST (".quote_smart($pluspieces).") AS relevance FROM affiliSt_products1 WHERE MATCH (prodName,prodBrand,prodCategory) AGAINST (".quote_smart($pluspieces).") $extracondition HAVING relevance > 0 $sortby";

    to:

    $query_product = "SELECT *, MATCH (prodName,prodBrand,prodCategory) AGAINST (".quote_smart($pluspieces)." IN BOOLEAN MODE) AS relevance FROM affiliSt_products1 WHERE MATCH (prodName,prodBrand,prodCategory) AGAINST (".quote_smart($pluspieces)." IN BOOLEAN MODE) $extracondition HAVING relevance > 0 $sortby";

  7. You can also filter them through the SELECT statement.  Depending on how site is stored

     

    $r=mysql_query("SELECT * , itemsa - itemsb AS itemstotal FROM `$table[0]` WHERE site != '' ORDER BY itemstotal DESC");

     

    or

     

    $r=mysql_query("SELECT * , itemsa - itemsb AS itemstotal FROM `$table[0]` WHERE site IS NOT NULL ORDER BY itemstotal DESC");

  8. What isn't working?

     

    I can see one problem.  There is a syntax error:

     

    $query="CREATE TABLE websitestable (websites varchar(100) NOT NULL,destination varchar(50) NOT NULL)

     

    should be:

     

    $query="CREATE TABLE websitestable (websites varchar(100) NOT NULL,destination varchar(50) NOT NULL)";

     

    However, that query will fail after the first time the script is run since the table will already be created.

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