Jump to content

cunoodle2

Members
  • Posts

    602
  • Joined

  • Last visited

    Never

Posts posted by cunoodle2

  1. My guess is that this code is OUTSIDE of the "<?php" bracket..

     

    "$start = ($page-1)*$per_page;

    $sql = "SELECT productId, productCode, image, name, price, stock_level FROM inventory WHERE productCode LIKE '%".$searchp."%' OR name LIKE  '%".$searchp."%' AND Seller_ID = '" . $_SESSION['SESS_SELL_ID'] . "' order by name limit $start,$per_page";

    $rsd = mysql_query($sql);"

     

     

  2. I'm betting you have an error in your html form.  Since IE is so loose on errors it may be slipping through.  I bet that "$id" is not even set or being passed in.  You need to do better error checking too after you get your results from the query.

     

    Do this..

    $getdata = mysql_query("SELECT * FROM motorola WHERE id=$id", $db);
    
    if (!$getdata)
    echo "There are no results
    else
    {
      $row = mysql_fetch_array($getdata);
    
                   $title = $row["title"];
                   $price_1 = $row["price_1"];
                   $price_2 = $row["price_2"];
                   $price_3 = $row["price_3"];
                   $imageaddr = $row["imageaddr"];
                   $description = $row["description"];
                   $keywords = $row["keywords"];
                   $time = $row["time"];
    }
    

  3. You are missing some code.  Please show us the actual code at line #3 which is where php says the issue is..

    "MySQL server version for the right syntax to use near 's','home')'"

     

    I'm guessing that you may have an older version of mysql or something.  However, I would need to see your code to even begin troubleshooting this.

  4. From what I know that is a FILE encryption as apposed to a string.  According to the manual it states "openssl_pkcs7_encrypt() takes the contents of the file named infile and encrypts them using an RC2 40-bit cipher"

     

    Can you give me a little more info on what you are trying to do?  Maybe there is a better/different way to do what you are looking for.  Are you also looking to be able to decrypt said string/file or is this 1 way (I.E. password, etc..)? 

  5. The issue is that your query will pull the value if ANY of the following items are true....

     

    1)  status ='1' AND (title LIKE '%a%')

    2) (titletext LIKE '%a%')

    3) (tags LIKE '%a%')

    4) (originaltitle LIKE '%a%')

    5) (url LIKE '%a%')

     

    What exactly do you want your results to be?  Since you are using "OR" if ANY of those items are true they will be pulled.  What mikesta707 is saying is that if you move the parenthesis around you will be able to alter your out put.  For example...

     

    SELECT * FROM videos WHERE status ='1' AND ((title LIKE '%a%') 
    OR (titletext LIKE '%a%')
    OR (tags LIKE '%a%') OR (originaltitle LIKE '%a%') 
    OR (url LIKE '%a%')) ORDER BY (videos.up-videos.down) DESC LIMIT 0, 5
    

     

    Note that I added in another set of parenthesis.  The query I wrote would be True only in 1 cases...

     

    1) status ='1' AND  ANY of the following are true..  (title LIKE '%a%') OR titletext LIKE '%a%')

    OR (tags LIKE '%a%') OR (originaltitle LIKE '%a%')

    OR (url LIKE '%a%')

     

     

  6. Well you need to first write a mysql query to gather all of the results.  I honestly don't know why you need to store them in an array unless you need to some how modify the order but that too should be able to be done in the query.  Then after you do the query loop through all results and echo them out to the screen.  Try writing out this code and let me know what you come up with.

  7. There may be a way to do this with a regular expression but I have no clue how to do that so I would do something like this..

     

    <?php
    
    //this case would be MM-DD-YYYY
    if ((strpos($dateStr, "-") == 2) && (strrpos($dateStr, "-") == 5)
         //then strip off the last 4 characters
    
    //this case would be YYYY-MM-DD
    else if ((strpos($dateStr, "-") == 4) && (strrpos($dateStr, "-") == 7)
         //then strip off the first 4 characters
    
    ?>

     

    would this work?

  8. Ok, so ping requests are blocked.  IF there is ANY files on said remote server even a hello.txt file with that simply contains the word "hello" on the page.. you could use php curl to or fopen to open said remote file.  IF the file can be opened and the word hello read in then you know the server is up and running.  If not then said server is down.  Let me know what you come up with.

  9. If you have phpmyadmin log into there, select your table and then in the mySql box copy and paste the query in.. "select * from listtest order by id asc"  What happens?  Any results?

     

    What if you View>Source of the page.  Is anything showing up then?  It could be you have an issue with your html

  10. I don't understand why you can't just ping the remote server first to see if it is up.  IF so then get token.  If not then allow the user to be able to see the limited section you mentioned.

     

    That or use php Curl to first open any page on said remote server to see if it is up.  IF so then get token.  If not then allow the user to be able to see the limited section you mentioned.

     

    Also, I have to say this too:  If the remote server is going down that often that it is messing up your code than maybe your code is not the problem here but rather this remote server.

  11. is the issue with the "require_once" statement?  If so then just change that to "include"

     

    In the "include" file can you possibly first "ping" this other server to verify it is up?  If so then you could do..

    If server_up then show documents and everything

    else

    show everything BUT documents.

     

    Make sense?

  12. I know that there is a much more efficient way to do this but this is the way that I know best..

     

    You will need to start off reading in the file.  I will assume that you know that and that you will store said items in the variable $contents.  You will need to modify the loop I use too.  This is very very rough code.

     

    <?php
    
    //start the CSV for your file
    $csv_string = "";
    
    //create a position counter for how far you are in the file
    $position = 1;
    
    //create a temp value to store temp strings in
    $temp_string = "";
    
    while (//you will need something here to determine the end but again that will depend on the method you are reading with)
    {
    //determine the starting location of the variable you are trying to strip
    $string_begin = strpos($contents,"dataFT", $position);
    $string_begin = strpos($contents,">", $string_begin) + 1;
    
    //determine the ending location of the variable you are trying to strip
    $string_end = strpos($contents,"<", $string_begin);
    
    //now you have the positions so you can strip out the variables
    $temp_string = substr($contents,$string_begin,$string_end-$string_begin);
    
    //now clean up any white space on the variable and then add it on to the end of the csv variable.
    $temp_string = trim($temp_string);
    $csv_string .= $temp_string.", ";
    
    //reset the position variable so you advance in the loop
    $position = $string_end;
    
    } //end of the loop
    
    //echo out your item here..
    echo $csv_string
    ?>

     

    Again, I know that this is not the most efficient way to do it but it does get you the results you need.

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