NO HABLO PHP/SQL
>Warning: mysqli_stmt_bind_param() expects parameter 1 to be mysqli_stmt, boolean given on line 9
>Warning: mysqli_stmt_execute() expects parameter 1 to be mysqli_stmt, boolean given on line 10
>just put some time into it
My whole life the last 3 days has consisted of nothing but the pain of this code not working, after attempt after attempt, while people who could easily tell me what to do tell me to put more time into it
And I just dropped out of high school and this website I'm making is pretty much my only change of having any income, so PLS
>STOP DOING THIS
>STOP USING THAT
JUST TELL ME WHAT TO DO
if this is not enough
>check if mysqli_connect really connects to DB
>your sql query might be fucked up (table does not exist etc)
use PHP framework like symfony2 or zend...
or use python framework like django
PHP is on the way out. Of course all top sites are still running PHP but new projects are now mostly being started in other languages/frameworks. This is because PHP is a piece of shit language and it is no longer the only real solution. Check out Python+Django or Rails or whatever Flavor of the Month.js
why would you limit yourself to microsoft users only?
mysqli_prepare is returning a bool because it's failing (does anybody even read the docs?? double click function name, right click "search google", READ)
you need to show your schema here.
>mysqli_prepare is returning a bool because it's failing (does anybody even read the docs?? double click function name, right click "search google", READ)
>Returns TRUE on success or FALSE on failure.
OK, you know what? This is exactly why PHP should never ever be used. Behold:
>mysqli_prepare() returns a statement object or FALSE if an error occurred.
So which is it, you piece of shit langauge??
it is not about language. you are going to have same issues with other programming languages as well. I understand that you are probably trying to self educate and it is fine. but you need to follow some good practices. first of all you should always check for exceptions / errors. I mean every time you run function/method that can fail there is usually parameter or return statement that needs to be checked or exception to be handled. that way you avoid having massive code that throws error "somewhere".
$what_ever = mysqli_prepare(......);
//rest of the code...
I don't see the problem, proper way to handle it is same as in any other language.
c based language would return null instead of object if error.
a modern non-shitty language would throw an exception
by returning false or the correct value, it violates the semantics of return
it should return a value or null if no value could be returned, and throw an exception if appropriate
well you can always wrap that function into another that does what you want. throw exception for example. latest PHP supports them.
don't get me wrong, I am not fan of PHP myself but I was forced to use it for one of my projects.
the point is that you shouldn't have to do shit like that to make the language work the way it ought to
not to mention that the standard library isn't even remotely consistent in the ways that it deals with errors
well you don't really have to, unless you are using outdated shit like mysqli. I used symfony2 framework with doctrine as orm and it was pretty much ok.
and consistency is price you have to pay for being open source I guess. yes it is shit language but it gets the job done.
Not even being a dick. PHP is an awful, very outdated, limited language. OP cripples himself by trying to stick to it. Look here (>>25844579) for a good example of how shitty it actually is as a language.
Ignore the tripfag PHP gets a lot of hate due to how shit some beginner code can be but with enough experience it can be a great language which is why everyone uses it.
Maybe use a PHP framework like other people have suggested if you are really unsure.
haha high school doesnt matter for that shit bro you never learn any kind of coding in high school that is useful unless its self taught. It just shows you are a low life fagget that dropped out and can actually do something. I graduated from highschool and college and I bet you know just a little more code than I do, but ive only been teaching myself for just over a month ;)