Jump to content

jakebur01

Members
  • Posts

    885
  • Joined

  • Last visited

Everything posted by jakebur01

  1. ok thanks.
  2. That's not what i'm trying to do. I want to select all of the available dates from a column, but not the same one twice. ex.: [b]date1 column[/b] 2007-08-05 2007-08-05 2007-08-05 2007-08-05 2007-08-06 2007-08-06 2007-08-08 2007-08-08 2007-08-11 2007-08-12 and select only the available dates and not the same one twice. like: 2007-08-05 2007-08-06 2007-08-08 2007-08-11 2007-08-12
  3. how do I select values from mysql but only display a certain value once. Ex. If I have a column that has 8 "3's", but I only want the 3 displayed one time so that it is not repeated.
  4. Thanks! What about my selection page where I select my dates. How could I loop through and create option values without displaying the same date twice?
  5. How do I query a date range? I have a date column in my mysql table. I want to select a range of rows between : Ex. 2007-08-05 through 2007-08-30 . I also would like to have the page that sends the query as a form.. option value that shows all of the available dates, so i can select a from date and a to date. I have never done anything with dates before, I need some help getting going.
  6. Why will it not convert to a string?
  7. I'm sorry. Here is line 183. $result.= @$conn->query($sql); /* Notice the . before the = , this appends the results to the previous results. */
  8. PHP Catchable fatal error: Object of class mysqli_result could not be converted to string in book_fns.php on line 183
  9. I have a web site with several thousand items, all the items are stored in a mysql database. I am trying to have it to where the user can enter a phrase and the search would pull the rows that relate. Problem: The way that I have it written now, users can only enter searches containing one or two words. And it works great with one or two words. But, I would like to update it to where if the client enters Ex. "Sx-495 Belt Starter" that it will still pull rows from the database with those words. Here's the way it is set up now. And they way I have these "or's" in the select statement, is this meaning one row or the other? function get_search_books($mysearch) { // query database for the books in a category $mysearch =$_POST['searchlike']; $mysearch= trim($mysearch); if (!$mysearch || $mysearch=='') return false; $conn = db_connect(); $sql = "SELECT No, description, title, author, isbn, price FROM books "; $sql .= "WHERE `No` LIKE '%$mysearch%' "; $sql .= "OR `description` LIKE '%$mysearch%' "; $sql .= "OR `title` LIKE '%$mysearch%' "; $sql .= "OR `author` LIKE '%$mysearch%' "; $sql .= "OR `isbn` LIKE '%$mysearch%' "; $result = @$conn->query($sql); if (!$result) return false; $num_books = @$result->num_rows; if ($num_books ==0) return false; $result = db_result_to_array($result); return $result; } Thanks, Jake
  10. Still no dice. I don't know what's going on, i've been playing with it. I don't want to drive you crazy with this thing man.
  11. It's not pulling anything now. What am I doing wrong? function get_search_books($mysearch) { // query database for the books in a category $mysearch =$_POST['searchlike']; $mysearch= trim($mysearch); if (!$mysearch || $mysearch=='') return false; $conn = db_connect(); $sql = "SELECT No, description, title, author, isbn, price FROM books WHERE MATCH No, description, title, author, isbn, price AGAINST '$mysearch'"; /* $sql = "SELECT No, description, title, author, isbn, price FROM books "; $sql .= "WHERE `No` LIKE '%$mysearch%' "; $sql .= "OR `description` LIKE '%$mysearch%' "; $sql .= "OR `title` LIKE '%$mysearch%' "; $sql .= "OR `author` LIKE '%$mysearch%' "; $sql .= "OR `isbn` LIKE '%$mysearch%' "; */ $result = @$conn->query($sql); if (!$result) return false; $num_books = @$result->num_rows; if ($num_books ==0) return false; $result = db_result_to_array($result); return $result; }
  12. Like this? $sql = "SELECT No, description, title, author, isbn, price FROM books WHERE MATCH No, description, title, author, isbn, price AGAINST '$mysearch'";
  13. I found some stuff on preg_match, is this what I need. I need a little boost on how to empliment something like that into the current code that I have.
  14. Please help me to better this search. It is searching columns in my database. If $mysearch is a phrase of three or four words the search does not work well at all. Only one word searches will pull data. Is their some way to bust up $mysearch to where it will search a phrase. Ex. "Universal Gas Cap" function get_search_books($mysearch) { // query database for the books in a category $mysearch =$_POST['searchlike']; $mysearch= trim($mysearch); if (!$mysearch || $mysearch=='') return false; $conn = db_connect(); $sql = "SELECT No, description, title, author, isbn, price FROM books "; $sql .= "WHERE `No` LIKE '%$mysearch%' "; $sql .= "OR `description` LIKE '%$mysearch%' "; $sql .= "OR `title` LIKE '%$mysearch%' "; $sql .= "OR `author` LIKE '%$mysearch%' "; $sql .= "OR `isbn` LIKE '%$mysearch%' "; $result = @$conn->query($sql); if (!$result) return false; $num_books = @$result->num_rows; if ($num_books ==0) return false; $result = db_result_to_array($result); return $result; }
  15. If I have say a thousand or so of my customers e-mails to send out, is their a way that I could set the execution time at the beginning of the script and loop through sending an e-mail to each individual one by one and pausing in between? Like, I know the browser might time out after 30 seconds if it does not receive any new data. Could I run a loop that would send a message to the browser every 10 seconds while running the sleep/mail loop. Ex. Loop to browser to keep it going - Send e-mail ---- sleep for a minute or so --- and send the next e-mail -- sleep -- and so on Thanks, Jake
  16. Is their any way to embed and create an interactive pdf as shown in the link below using php? http://www.grainger.com/Grainger/wwg/viewCatalogPDF.shtml?browserCompatable=true&adobeCompatable=true&toolbar=false
  17. Can you comunicate providex(a language from business basic) with php?
  18. thanks a bunch!
  19. hey, my code was working fine yesterday. I have a html page with a form and a php page that plugs the posted fields into a .rtf file. All of a sudden i get this error: Warning: Cannot modify header information - headers already sent by (output started at Thanks, Jake
  20. I need help with this. I don't know how it's supposed to be. echo '$myrow["Dealer"]'.<br />.'$myrow["Address"]'.<br />.'$myrow["City"]'. .'$myrow["State"]'. .'$myrow["Zip"]'. <br /> .'$myrow["Phone"]'.<br />.'You are $value miles away from this $dname dealer.';
  21. anybody?
  22. Hi all, what i'm trying to do is take data from a form on an html page and display the data on two pages that someone can print. I was having a little trouble attemping to do so with a .pdf. Any suggestions?
  23. I am having trouble generating a .pdf . I have a html page with several form fields, I am only posting two fields to php for testing purposes. I created a .pdf named PHPCertification.pdf with <<NAME>> <<Name>> <<score>> <<mm/dd/yyyy>> in the text. Here is my php code: <?php set_time_limit( 180 ); // this script can be slow //create short variable names $SSC_COMPANY = $_POST['SSC_COMPANY']; $SSC_DATE = $_POST['SSC_DATE']; function pdf_replace( $pattern, $replacement, $string ) { $len = strlen( $pattern ); $regexp = ''; for ( $i = 0; $i<$len; $i++ ) { $regexp .= $pattern[$i]; if ($i<$len-1) $regexp .= "(\)\-{0,1}[0-9]*\(){0,1}"; } return ereg_replace ( $regexp, $replacement, $string ); } if(!$SSC_COMPANY||!$SSC_DATE) { echo '<h1>Error:</h1><p>This page was called incorrectly</p>'; } else { //generate the headers to help a browser choose the correct application header( 'Content-Disposition: filename=cert.pdf'); header( 'Content-type: application/pdf' ); $date = date( 'F d, Y' ); // open our template file $filename = 'PHPCertification.pdf'; $fp = fopen ( $filename, 'r' ); //read our template into a variable $output = fread( $fp, filesize( $filename ) ); fclose ( $fp ); // replace the place holders in the template with our data $output = pdf_replace( '<<NAME>>', $SSC_COMPANY, $output ); $output = pdf_replace( '<<Name>>', $SSC_COMPANY, $output ); $output = pdf_replace( '<<score>>', $SSC_DATE, $output ); $output = pdf_replace( '<<mm/dd/yyyy>>', $date, $output ); // send the generated document to the browser echo $output; } ?> I get an acrobat message box saying that the file is damaged and could not be repaired.
×
×
  • 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.