Skip to main content
Filter by
Sorted by
Tagged with
3 votes
5 answers
22k views

Num rows not found in the documentation Codeigniter 4. My method in my model: public function getListCat() { $listCat = $this->asArray()->where(['id_user' => $session->id])->get();...
илья Илья's user avatar
-1 votes
1 answer
44 views

So this is my code, but whenever I run this code i get this message (Notice: Trying to get property 'num_rows' of non-object in F:\xampp\htdocs\php\index.php on line 31) and I can't find the problem. ...
Unknown's user avatar
0 votes
3 answers
1k views

Making a login form and this is my first time using prepared statements. My issue is the num_rows keeps returning 0, despite entering the correct email and password that matches the email and password ...
Mechromancer's user avatar
1 vote
3 answers
11k views

Okay this is going be probably very simple, but I've spent 4 hours on this and I'm giving up to ask what I'm missing. I am doing an SQL SELECT statement: "SELECT username, id, Days FROM Users ORDER ...
London O'Connell's user avatar
-1 votes
5 answers
776 views

I have a query command which run in mysql tools. SELECT * FROM t_table1 WHERE id=18888 but when I try to execute this command in PHP CodeIgniter, but there are no rows returned. I tried to get the ...
Anton's user avatar
  • 1
0 votes
2 answers
1k views

I have the PHP code: $query = mysqli_query($mysqli, "SELECT * FROM `table_1`"); $result = mysqli_num_rows($query); $queryTwo = mysqli_query($mysqli, "SELECT * FROM `table_2`"); $resultTwo = ...
Bogdan C's user avatar
  • 399
0 votes
0 answers
54 views

I have code that supposed to show new items in menu (right of the items.php url). That's not working at all or it shows only one item though there is 10 items. It count's new items and check when your ...
Penalse's user avatar
  • 195
0 votes
1 answer
528 views

In my test-surroundings there is a database containing some Person Information (Name, E-Mail, Adress etc.). These Informations can be inserted by anyone into the database via a form. In the background ...
3x071c's user avatar
  • 1,036
6 votes
2 answers
2k views

First of all I would like to tell that I have already gone though ALL DUPLICATE questions. and tried the changes suggested there. As far as now I have already tried changing num_rows to num_rows() ...
GeekWithGlasses's user avatar
1 vote
1 answer
433 views

Help. I am getting 0 num_rows but if i execute the query in the console i am getting results. I m kinda new to prepared stmts. Here is my code Database connection class: class DbConnection { const ...
Redgren Grumbholdt's user avatar
-2 votes
2 answers
2k views

I´ve read many topics with the same problem, but neither of any solved my problem. I´ve got following code: $connection = mysqli_connect('...'); if(mysqli_connect_errno()) { die('Connect Error')...
user avatar
0 votes
2 answers
449 views

I have this code for the select and printing values. mysql_numn_rows returns null :/ <?php mysql_connect('localhost','root',''); mysql_select_db("db2517"); $username = "Cristoforo"; $query = ...
Cristoforo's user avatar
0 votes
1 answer
123 views

I'm trying to get my $num_rows working. It had been working, and now it's not. Reading this site it was suggested I install MySqlnd on my server because some things like fetch_array and get_result ...
CHarris's user avatar
  • 2,803
0 votes
1 answer
130 views

I know this has been discussed but the problem is slightly confusing. I am using mysqli prepared statements, but I also tried with raw queries. num_rows is always 0, and I have no Idea why. As a ...
Rico Del Garcia's user avatar
0 votes
1 answer
104 views

I have a very strange problem today. I have a section of code which queries a table based on a GET variable passed from a user input (pretty standard). However for this to work I have to include a ...
Benjamino's user avatar
0 votes
2 answers
461 views

I am trying to perform a wildcard search query using CI. I am checking for loggedin sessions. If a user is logged into more than one device, a popup is displayed. To check if the user is logged in ...
Ankur Sinha's user avatar
  • 6,664
0 votes
0 answers
61 views

I want to check if a successful query has returned no results. When testing this script locally, I make sure that the database does not contain any values the query is seeking, but mysqli_num_rows($...
Callum's user avatar
  • 313
0 votes
2 answers
33 views

I'm trying to find out if the title someone filled in in a form is already in the database (cause otherwise I'm going to add a number to the title). But somehow the code underneath always give back "...
Manuel van den Notelaer's user avatar
1 vote
2 answers
1k views

I am trying to execute a select query in CodeIgniter like below: public function validate() { $username = $this->security->xss_clean($this->input->post('username')); $password = $...
Santosh Khatri's user avatar
0 votes
1 answer
30 views

I'm very new here as well as in php and mysql and I hope you can help me :) I'm trying to build a JSON for a visualization using data from a database. My problem is, that it doesn't passes the if-...
Maki's user avatar
  • 119
0 votes
2 answers
128 views

I do have a search form on a page which search records from a table in my database. I want to show how many results each query gives us. All this is written in codeigniter. All my code on that page: &...
Tiger GFX's user avatar
-3 votes
1 answer
53 views

I want to just check if the username already exists within the database for my signup page, to do this I figure I can just do a select query with the input username and see how many results I get back....
Doncho's user avatar
  • 41
7 votes
1 answer
23k views

im trying to use mysql_num_rows in laravel but laravel says it not the same way like in 'raw php' example: $users = DB::table('users') ->where('username', '=', $username) ->...
indian's user avatar
  • 75
0 votes
1 answer
90 views

I have a query which perform fine, but the problem is somehow its gives me the warning when no data match from database. $count = mysql_num_rows($qry); //warning here I can use @ to hide the error, ...
user avatar
0 votes
2 answers
116 views

I'am currently making a login system for news website as part of my coursework. For some reason when I use $rows->num_rows == 1 in an if statement, it always runs the "else" code. Basically this means ...
Kent Godfrey's user avatar
0 votes
1 answer
474 views

I'm trying to move to PDO. I want to do a classic query for checking number of rows, in mysql I would have done mysql_num_rows_result but I've read somewhere that in PDO it does not work. So I've ...
Stanislas Piotrowski's user avatar
0 votes
6 answers
104 views

I have a table like: +------------+-------------------+--------------+------------+ | listing_id | transaction_title | image_thumb | sale_date | +------------+-------------------+--------------+----...
Acidon's user avatar
  • 1,334
1 vote
3 answers
609 views

I want to make codeigniter pagination with where db query. My model: (update) public function get_all_produk_row($url = ''){ data = array(); $this->db->where(array('kategori.url'=>$url,'...
Vinsens's user avatar
  • 199
0 votes
1 answer
37 views

$assault_checker=mysql_query("SELECT * FROM assaults WHERE host_id='".$_SESSION['user']."' OR guest_id='".$_SESSION['user']."' AND status='0'"); $assault_checker=mysql_num_rows($assault_checker); I ...
Diogo Alpha's user avatar
0 votes
1 answer
53 views

So I'm Getting The Error: Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\All Connected\profile.php on line 117 While Try To Check For Friend Request ...
Levi Johnson's user avatar
1 vote
3 answers
466 views

I know the problem, But I cannot seem to fix it, and I was hoping someone on here could steer me in the right direction, What I want to do is check to see if a user has already submitted a correct ...
Keiththolt's user avatar
0 votes
2 answers
138 views

My test code: $connection = mysql_connect('localhost', 'root', '') or die(mysql_error()); mysql_select_db("chaoge", $connection); mysql_query("SET NAMES UTF8", $connection); $rs = ...
tripleCC's user avatar
-1 votes
3 answers
207 views

I'm having trouble where should i put my echo 'No Result Found'; in the code code I tried putting it in the last else statement together in code for debugging but it doesn't work. Please help where ...
Nathan Nathaniel's user avatar
2 votes
0 answers
30 views

I try to create an if / else action, based on the number of rows in my DB. $gekoppeldeDB = $_POST['gekoppeldeDB']; $sql_bon = mysqli_query($mysqli, "SELECT * FROM $gekoppeldeDB"); $rowcount = ...
Jeffrey van Zwam's user avatar
3 votes
3 answers
371 views

So, I have some code. I know that mysql_num_rows is deprecated, but since I've already used it I don't want to switch everything to mysqli_. Anyway it was working on my local server and returning 1 or ...
brocksprogramming's user avatar
0 votes
2 answers
158 views

I have a page that displays a MySQLi query result array. On this page the data comes to the page correctly but for my $result['rows'] which is the result of num_rows of the array results are showing ...
Derek's user avatar
  • 27
0 votes
1 answer
89 views

$sql=SELECT COUNT( * ) FROM attendance3 WHERE name = 'Hema' AND attend = 'Absent' AND MONTH = 'July' AND year = '2015' AND user = 'mars'. In php we can get the count $res = mysql_query($sql); $row = ...
manjusha's user avatar
  • 123
0 votes
1 answer
116 views

First off, yes, I know mysql_num_rows() is deprecated. Now, continuing on to the actual question, I'm making a page where users can post things and other users can like them. But when the post ...
kzhao14's user avatar
  • 2,660
1 vote
1 answer
337 views

I'm trying to show icon.envelop.2.gif if there are any messages with message_status = 2. However for some obscure reason this query returns 0. What have I missed here? The $_SESSION['user_id'] is ...
Gjert's user avatar
  • 1,067
0 votes
1 answer
76 views

so I have little problem, because I need to check if "product" exists in database, and if not, I want to create one. I was doing something like this: $tekst2 = "SELECT * FROM product WHERE nazwa = '$...
Mateusz's user avatar
  • 331
1 vote
1 answer
280 views

This is a question regarding the mysql_num_rows command. Basically what I want to ask if it's possible to sum the results up and order them in a descending order. $fetchrank = mysql_query("SELECT * ...
Ahmed Beni Touzine's user avatar
1 vote
0 answers
424 views

$getPrd = mysql_query("SELECT * FROM products LEFT OUTER JOIN productscontent ON productscontent.productsID = products.id WHERE productscontent.title LIKE '%".$search."%' OR productscontent.alltext ...
Xeen's user avatar
  • 7,023
0 votes
2 answers
14k views

I'm a beginner in php & mysql. The num_rows is not working in the below basic example. The whole script is inspired by the example in w3schools. w3schools example. the browser shows an error ...
Wajahath's user avatar
  • 4,236
0 votes
2 answers
5k views

im trying to make an option for an admin, to choose in which order to show the categories in the website. so in the control panel, he has an up arrow and a down arrow next to each category's title. ...
TheDragoner's user avatar
-1 votes
2 answers
185 views

Edit Note: There was nothing wrong with this comparison operator. I was asked to expound, so added the code below. As it turned out, the problem was in the UniqueID function I was using to create a ...
RationalRabbit's user avatar
0 votes
0 answers
83 views

I need help to solve a problem. I have this script twice on my page in two diffrent divs. The first script works fine and the second also, but when i run the script at the same time on the page only ...
Quarskel's user avatar
0 votes
1 answer
240 views

I'm experiencing an issue with a for loop in the following code: <?php // connect to database and establish $link, okay // log in user if possible and get $userID, okay // if logged in, get list ...
Reno Blair's user avatar
-5 votes
1 answer
234 views

Please help me I want my program to choose a site if it has not yet username then it will proceed it to ch_uname.php. Then if the login credentials have already username then it will be preceded to ...
RumRum's user avatar
  • 59
0 votes
2 answers
528 views

I keep getting an error on line 20, "if(mysqli_num_rows != 0)". The error reads: "Notice: Use of undefined constant mysqli_num_rows - assumed 'mysqli_num_rows' in C:\wamp\www\movieDB\movies.php on ...
TristanKenneth's user avatar
-3 votes
1 answer
120 views

I have a problem with my script: i believe mysql_num_rows won't find anything from my database even though i know there is something in there (two records actually).... Anyone help? <?php $con = ...
KingJoe199's user avatar