Skip to content

Tag: php

MySQLi $userid returning 0

I’m just learning the ropes of MySQLi, so got this mostly from a tutorial (though had to throw in parts from different sites – hence the errors). Is anyone able to explain why $userid returns 0 instead of 1 that it should be? I’m hoping it’s a simple mistake. The query is correct, I&#8…

Laravel: Validation unique on update

I know this question has been asked many times before but no one explains how to get the id when you’re validating in the model. My validation rule is in the model so how do I pass the ID of the record to the validation rule. Here is my models/User models/BaseModel Answer One simple solution. In your Mo…

Facebook Graph API PHP SDK v4 – Post on Page

I wanna give all my website authors a possiblity to post their articles on our facebook page without having go give them admin access to it. So i created a simple form, where the author types in: URL, URL to image, message On submit, this form will send a ajax request to facebook.php where the magic “sh…