PDA

View Full Version : PHP & MySQL, need help!



P1nky
12-11-2014, 06:18 AM
I am having issues fetching data from the table;

Basically using a basic register form that sends out the information to the database, I have another tab that states 'view users' but for some reason I am unable to fetch the register information in the 'view user' tab. Also I had made sure to check if the information was being fed in cPanel x, so everything looks just fine there.


"Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in /home/has2314c/public_html/m3/view_users.php on line 78"


http://pastebin.com/kUjGVzur < mysqli_connect.php

http://pastebin.com/1Y7XVdDq < view_users.php



Line 78:
"$r = @mysqli_query ($dbc, $q); // Run the query."


Thank you,

P1nky

Frement
12-11-2014, 06:52 AM
How about you remove all the @'s from the commands? That way you can get the errors. Your query is failing, thus returning false, which is not accepted by mysqli_fetch_array. You can either check for is_object() or != false.

P1nky
12-11-2014, 11:49 AM
How about you remove all the @'s from the commands? That way you can get the errors. Your query is failing, thus returning false, which is not accepted by mysqli_fetch_array. You can either check for is_object() or != false.

I had deleted all the @'s and nothing really changed, just gave me another warning for line 21.










Competition Requirements:

Registered Users & Jr Members ONLY
The script cannot consist more than 300 lines
NO Plagiarism
NO SRL Members
You haven't already released the script
NO cheating (No partnering up)
note: You may ask however many questions you want regarding script errors/code help.


Prize:


Donators so far:
[•P1nky •StickToTheScript •grats •The Mayor •cosmasjdz •Nemesis3x






The 5 Checkpoints



Below is a quick summary of what you have to consider to pass them successfully


Technique (/100)

This relates to what type of loops you have used where, how you found that certain object on the floor, how you detected that door, how you made sure your script was fail safe. It also refers to issues such as whether you should have used DTMs / DDTMs / bitmaps there or not, how you have found an ore/tree/etc., and if you could have done this any better

Individuality (/100)

This refers to whether your scripting style is your own or not. The more individual your script is, the better it is for you, because this means you really understand what all of the different procedures / functions / types / methods should be used for. it means you are relying less on other people, and are developing your own style.

Use of SRL (/100)

This relates to how well you have used the SRL include. Are you creating custom functions that are already in SRL, or are you using the existing ones in the include. Also, are you using them correctly? There is no point in creating something which is already in the include. Basically this shows how well you have looked through the include before resorting to making it yourself, and it shows your understanding of the include as well.

Efficiency (/100)

The more efficient the script is, the better it is. Why constantly write out procedures when you can use a simple repeat instead? Are you using "end else" when needed? Do you have duplicate functions? Are you freeing DTMs / bitmaps after finishing with them? The more efficient your script is, the better it will run, and the easier errors will be to fix when they arise. No more than 300 lines.


Meeting Requirements (/100)

How did the script run when we tested it? Did it do what it was asked for? Any problems? As simple as that.

Credit: The Great 'StarBlaster100'



"May the SRL Gods be with you!"

xtrapsp
12-11-2014, 12:25 PM
I had deleted all the @'s and nothing really changed, just gave me another warning for line 21.

What's the warning?

Frement
12-11-2014, 01:34 PM
I had deleted all the @'s and nothing really changed, just gave me another warning for line 21.

Instead of using "OR die(..." try using:

if (mysqli_connect_errno()) {
die("Could not connect to MySQL: ".mysqli_connect_error());
}