Jump to content

taquitosensei

Members
  • Posts

    676
  • Joined

  • Last visited

  • Days Won

    2

taquitosensei last won the day on July 12 2019

taquitosensei had the most liked content!

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

taquitosensei's Achievements

Regular Member

Regular Member (3/5)

6

Reputation

2

Community Answers

  1. You can use LIMIT in mysql select rows from table limit 1,21 would return the first 21 results. You'd have to build in some logic to determine which page you're on. Here's an example. https://www.myprogrammingtutorials.com/create-pagination-with-php-and-mysql.html
  2. a boolean is 1 or 0, true or false. Usually a column labelled as "unread" would be a boolean telling you whether it had been read or not. If it's supposed to hold the user's id, you should rename it. But after looking at your table here is what the query should look like. $stmt = $this->db->prepare("SELECT unread FROM pm WHERE unread=1 and receiver_id=:id") This would get all of the results that were sent to your user that have not been read. You don't need the bind_result line. I believe that's a mysqli function and not needed with pdo.
  3. What does the unread table look like. You only need to bind when you're putting user submitted data in your query. You don't have to do that with unread=1. Also unread shouldn't ever equal an id, because it's probably a boolean. Your query should probably look more like this if($stmt = $this->db->prepare("SELECT unread FROM pm WHERE unread=1 and id_field=:id")) { $stmt->bindParam(':id', $id, PDO::PARAM_INT); }
  4. The PR_END_OF_FILE_ERROR is either an issue with the format of your certificate or you might have an older version of nss.
  5. You would need to involve javascript. You could do this almost all in javascript then do an ajax call to send the data to php. Here's a guide that shows how to listen for sound and make a reactive page. It should give you an idea of how to start. https://hackernoon.com/creative-coding-using-the-microphone-to-make-sound-reactive-art-part1-164fd3d972f3
  6. You don't need to decode. Store the users info in your database. Pre-fill the form. Let them change the info. Then generate a new QRCode and update your database.
  7. $dt4->add($dif); I think that gives the result expected. Not sure why. 2019-07-15 12:30:00 | 2019-07-17 14:15:30 | 0 0 2 1 45 30<br>2019-08-17 01:45:30 | 2019-08-19 03:31:00 | 0 0 2 1 45 30<br>
  8. Need more info. What is it supposed to do, what is it not doing. I 2nd foreach. $files = array("file1.php","file2.php","file3.php"); foreach($files as $file) { include($file); }
  9. there is something wrong with $query->wheres, it's not countable. So it's not an array or not an object. Do var_dump($query->wheres); after the $query = to find out what it is and what it does contain.
  10. I usually echo at the end of the script instead of in the loop and also send 200 http response. $result = $page->read($_GET['pageid']); //check for data if ($result) { //page array $page_arr['pages'] = array(); while ($row =$result->fetch(PDO::FETCH_ASSOC)) { extract($row); $page_item = array( 'id'=> $id, 'title' => $title, 'pageid' => $pageid, 'pagecontent' =>html_entity_decode($pagecontent), 'mdkeywords' => $mdkeywords, 'description' =>$description, 'date_added' =>$date_added, 'hasAudio' => $hasAudio, 'excludeSearch' =>$excludeSearch ); //push to data array_push($page_arr['pages'], $page_item); } http_response_code(200); } else { $page_arr['message']="Nothing Here!!!"; } echo json_encode($page_arr);
  11. I didn't even think about using the max function. $numbers = array(1,3,7,8,10,12); foreach($numbers as $number) { if($number%2==0) { $evens[]=$number; } } $max_number = max($evens); echo $max_number;
  12. $numbers = array(1,3,7,8,10,12); foreach($numbers as $number) { if($number%2==0) { if($number > $old_number) { $max_number = $number; } $old_number = $number; } } echo $max_number; Not sure what nodejs has to do with anything. This is a php forum. Something like this would do it in php.
  13. If you're not seeing the results you expect in console. I use postman for troubleshooting. You can put in the URL and the post data in json format, and run it to see what the result actually is. You could have an error in my_cart.php. You could be outputting something along with your json. Your json may not be formatted properly. I would add this ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); to the beginning of my_cart.php and either view the results in development tools or download postman and try it that way.
  14. A white screen could be a fatal error. I would turn on error reporting put ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); at the top of your index.php, if it is a fatal error, the error should display instead of the white screen.
×
×
  • 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.