displaying records
4 posts
Page 1 of 1
hello
im using this to display my records in a table with pagination but it will show all the records but i want it do it only shows the records that the username put in to the database i tried this.
below shows all the records
im using this to display my records in a table with pagination but it will show all the records but i want it do it only shows the records that the username put in to the database i tried this.
below shows all the records
Code: Select all
this is ment to just show the records off the person logged in but seems to get an error.
$sql = 'SELECT * FROM orders LIMIT '.$page1.', 4';
Code: Select all
$sql = 'SELECT * FROM orders WHERE OrderBy = '$username'LIMIT '.$page1.', 4';
Thu Apr 16, 2020 4:57 pmMark wrote: helloMaybe try:
im using this to display my records in a table with pagination but it will show all the records but i want it do it only shows the records that the username put in to the database i tried this.
below shows all the recordsCode: Select allthis is ment to just show the records off the person logged in but seems to get an error.$sql = 'SELECT * FROM orders LIMIT '.$page1.', 4';
Code: Select all$sql = 'SELECT * FROM orders WHERE OrderBy = '$username'LIMIT '.$page1.', 4';
Code: Select all
Unsure if that will work but let me know either way.$sql = "SELECT * FROM orders WHERE OrderBy = '$username' LIMIT '.$page1.', 4";
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
Also what is the error?
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
Might have been a small error in your code that was provided. Sometimes its a bit buggy when you try and place variables into a string. Can you try the following?
When you are using LIMIT, you are passing a number, make sure to also leave out the '.
When you are using LIMIT, you are passing a number, make sure to also leave out the '.
Code: Select all
$sql = "SELECT * FROM orders WHERE OrderBy = '{$username}' LIMIT {$page1}, 4";
Code: Select all
$sql = 'SELECT * FROM orders WHERE OrderBy = '" . $username . "' LIMIT '" . $page1 . "', 4';
4 posts
Page 1 of 1
Copyright Information
Copyright © SplickerSnap.com 2020