Syntax explaination | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Syntax explaination

Hi, I am new at php. I need to understand what does the colon before user_id(":user_id") mean in the second line. <code> $stmt = $auth_user->runQuery("SELECT * FROM users WHERE user_id=:user_id"); $stmt->execute(array(":user_id"=>$user_id)); $userRow=$stmt->fetch(PDO::FETCH_ASSOC); </code> Thanks for your time.

9th Mar 2019, 2:29 PM
Samir Imtiaz
Samir Imtiaz - avatar
2 Answers
+ 1
Before "user_id" I think it's not semicolon, it's a colon.😊
9th Mar 2019, 3:50 PM
Shivam Dubey
Shivam Dubey - avatar
0
You are right . I have corrected it.Can you please explain that line?
9th Mar 2019, 3:52 PM
Samir Imtiaz
Samir Imtiaz - avatar