I know it’s too late, but for the help for you(May be) and other people:
Here you mistaken the '$category_id'
, remove that single quotes.
public function searchCategoryByTag($id) { $category_id = Products::findOrFail($id); $records=\DB::table('products')->Where('category_id', $category_id); }
Related Posts:
- PDOException SQLSTATE[HY000] [2002] No such file or directory
- PDOException SQLSTATE[HY000] [2002] No such file or directory
- When to generate a new Application Key in Laravel?
- No Application Encryption Key Has Been Specified
- Laravel 5 Class ‘Collective\Html\HtmlServiceProvider’ not found on AWS
- Laravel 5 MethodNotAllowedHttpException in RouteCollection.php line 201:
- Why do I have to run “composer dump-autoload” command to make migrations work in laravel?
- Laravel 5 Clear Views Cache
- How to log in to phpMyAdmin with WAMP, what is the username and password?
- Should I use mysqli_real_escape string() or mysql_real_escape_string() for form data?
- count() parameter must be an array or an object that implements countable in laravel
- Whoops, looks like something went wrong. Laravel 5.0
- Fatal error: Call to undefined function mysql_connect()
- http://localhost:80 is not working on running Apache server through UniServer ZeroXIII
- Mysql query- How to use contains?
- mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in
- Invalid column count in CSV input on line 1 Error
- Invalid column count in CSV input on line 1 Error
- Expected status code 200 but received 500
- $wpdb->update or $wpdb->insert results in slashes being added in front of quotes
- PDO with INSERT INTO through prepared statements
- phpMyAdmin: secret passphrase?
- laravel updateOrCreate method
- PDO bindParam() with prepared statement isn’t working
- How to listen messageSent event in laravel 5.5
- Forbidden :You don’t have permission to access /phpmyadmin on this server
- Could not open input file: artisan
- Creating a search form in PHP to search a database?
- How can I do ‘insert if not exists’ in MySQL?
- Fatal error: Call to a member function bind_param() on boolean [duplicate]
- MySqli Commands out of sync; you can’t run this command now
- Trying to get property of non-object in
- Fix Access denied for user ‘root’@’localhost’ for phpMyAdmin
- What is Options +FollowSymLinks?
- Getting connection failed: php_network_getaddresses: getaddrinfo failed: Name or service not known
- Commands out of sync; you can’t run this command now
- Laravel 5.2 Storage::makeDirectory($dir) is not creating directory
- Lost connection to MySQL server at ‘reading initial communication packet’, system error: 0
- PHP with MySQL 8.0+ error: The server requested authentication method unknown to the client
- SQLSTATE[HY093]: Invalid parameter number: parameter was not defined
- How can I do ‘insert if not exists’ in MySQL?
- Trying to get property of non-object – Laravel 5
- Object of class DateTime could not be converted to string
- What does it mean to escape a string?
- Convert from MySQL datetime to another format with PHP
- MAMP “Apache couldn’t be started because port is in use.” AND “Can’t connect to local MySQL server through /tmp/mysql.sock
- mysqli::query(): Couldn’t fetch mysqli
- Unexpected Exception: SQLSTATE[HY000] [1045] Access denied for user ****@’localhost’ (using password: YES)
- Uncaught Error: Call to undefined function mysql_escape_string()
- NotFoundHttpException in RouteCollection.php line 161: in laravel 5
- Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in
- Call to a member function on null?
- SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens on line 102
- Warning: mysqli_query() expects parameter 1 to be mysqli, resource given
- MySQL query to get column names?
- What does MYSQLI_NUM mean and do?
- How to Create Multiple Where Clause Query Using Laravel Eloquent?
- Mysql where id is in array
- ERROR: SQLSTATE[HY000] [2002] No connection could be made because the target machine actively refused it
- What is the advantage of using try {} catch {} versus if {} else {}
- select * from table where column = value ^ column2= value
- Deprecated: mysql_query() [duplicate]
- cURL request in Laravel
- Laravel – Model Class not found
- Fatal error: Call to a member function query() on null
- SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known
- mysqlworkbench giving version error on exporting database
- How to make DROP INDEX IF EXISTS for mysql?
- What is the meaning of sprintf(): Too few arguments
- Having a problem getting mysqli_query to execute
- CodeIgniter: Unable to connect to your database server using the provided settings Error Message
- Can I store images in MySQL
- MySQL Daemon Failed to Start – centos 6
- How to insert TIMESTAMP into my MySQL table?
- How to remove index.php from WordPress site URL
- PHP Like thing similar to MySQL Like, for if statement?
- How get value from URL
- How to use Memcached with PHP7?
- select count(*) from table of mysql in php
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ””)’ at line 2
- Array to String PHP?
- How to parse a CSV file using PHP
- Cannot use object of type stdClass as array?
- mysqli_real_connect(): (HY000/2002): No such file or directory
- Deleting an element from an array in PHP
- Call to undefined method mysqli_stmt::get_result
- How to reformat date in PHP?
- Cannot simply use PostgreSQL table name (“relation does not exist”)
- file_get_contents(“php://input”) or $HTTP_RAW_POST_DATA, which one is better to get the body of JSON request?
- file_get_contents( ) not working
- cannot change admin password, wordpress on godaddy
- Check if post of title already exists
- Update some database fields when post is saved
- sql query to put quotes around numbers in img tag
- Strange wordpress slowness
- Use variable in SQL statement
- Cant create table on plugin activation
- Advanced WordPress SQL Query
- How to detect if a revision was made by woocommerce or wordpress?