How to display the 'Favorites / Loved' list in Laravel 5.3?

I have implemented a like/favourite function in my application, where a user can favourite a Charity - this is then stored in a table in my database - which is working reasonably well. How would I go about outputting the users favourites list to them

How to get the value of a given key if it is found in a table?

This question already has an answer here: How can I access an array/object? 4 answers I'm trying to get the value of a given key if found using the array_key_exists function. $var = 35; if(array_key_exists($var, $_SESSION['cart_items'])) { //give the

Simple PHP array codeigniter controller

I would like to shorten my CodeIgniter controller a bit. Now it looks like this: case 'klant1': $data['title'] = $page; $this->load->view('templates/header', $data); $this->load->view('pages/klant1', $data); $this->load->view('templates/

Laravel 5 entry :: get an error

Why am I having this error? I tried to add use Illuminate\Http\Request; but same error? Also is $username = $request->input('username'); the same as $username = Input::get('username');? The error I get is: FatalErrorException in LoginController.php l

Php and mysql syntax issues using update instructions

i am trying to figure out the syntax problem in my query the block of code goes like this: $updatequery = "update patient_dim set dentist_id = $dentist_id where". "patient_id = $patient_id"; $queryResult = mysql_query($updatequery,$con

Syntax error in my registration form

I have a syntax error in my php script and cannot figure out why this is failing. Here is my code: PHP <?php if ($_SERVER [ 'REQUEST_METHOD' ] == 'POST' ) { require ('connect_db.php'); $errors = array(); if (empty($_POST[ 'first_name'])) {$errors[] =

PHP table empty outside the function

This question already has an answer here: Reference: What is variable scope, which variables are accessible from where and what are "undefined variable" errors? 3 answers <?php echo '<pre>'; error_reporting(E_ALL); $pid = '129'; $famili

Change image with a fade

I'm working on a site here: They've now decided they want the pictures to fade in when you click a thumbnail rather than just have the image switch. The current code is: <div id="mainimage"> <

The inscription script.php does not work

I have a registration script that doesn't work. It used to work but then suddenly it stopped working. I dont know what I've done or what happend. I have tried for like an hour now to find out where the problem is, but I can't seem to find it. What ha

FOSRestBundle and Mongodb cursor object to json

I'm currently working on a RESTful API using Symfony2 with FOSRestBundle. I love Mongodb, so i've implemented just that, here is a snippet of my usercontroller. /** * @return View view instance * @View() */ public function allAction() { $users = $thi

Check if there is a URL between the span tags

I got a HTML code containing following: <span rel="url"></span> <span rel="url"> [SOMETHING]</span> <span rel="url">[SOMETHING]</span> [..] The q

Ajax jQuery post to PHP script gives error 404

I'm trying to program an online experiment which posts some data using jQuery and ajax to a PHP script which saves the data to the text file, and I'm having some issues. The script works fine when the data I post is small (say 2kb) and will correctly

form will not send data in ie8

I have a form on my page, with one text input and one submit input, that sends info to a php script. Users can submit the form either by pressing 'enter' on their keyboard, or clicking the submit button. In IE9 and ever other browser, the user can hi

MySQL Query - Add Columns & amp; rows

I currently have two tables, one is products and the other is options (colour, size, etc). If no options are specified for the product, it puts the stock against the product table Otherwise it will put the stock against the option table Tables look a

PHP - Object Mixing Injection & amp; heritage

This is a follow up question on the following answer : Parent Object in php class A { protected function doSomeStuff(){ echo 'a method that all children will need to call'; } } class B { protected $_parent; public function __construct($parent) { $thi

How can I pack PHP's inheritance code into Kohana?

I have a good amount of legacy code written in PHP, which was not written on any particular framework rather it is mostly old-school style (i.e. inline) PHP. However, most of my new code is written on the Kohana 3.1.X framework. Although Kohana does

php: Mysql Database Design and Workflow, need more creativity!

i was wondering if any one can help me with my php-mysql design my current app. (is a more or less survey app) it let users store questions about targeting specific features in other products also saved in other table in database ! for example , a us

PHP validation problem

I have a form which I am validating on client side for user interaction and server side for data integrity. Now on client side when an input is wrong or empty I show an alert box which shows the error message.Now on the server Side should I run the s

php + mysql_num_rows

is there a more efficient way of doing the following? $total_a = mysql_query("SELECT `id` FROM `table` WHERE `this` = 'that'"); $total_b = mysql_num_rows($total_a); if(!$total_b) { echo 'no results'; } else { $a = mysql_query("SELECT `id`,