mysql - retrieve row result using prepare statement in mysqli -


  $ stmt = $ db- & gt; तैयार ("चुनें * उपयोगकर्ता से कहां नाम =?"); $ Stmt-> gt; bind_param ('s', $ username); $ Stmt- & gt; निष्पादित (); $ Stmt- & gt; store_result (); अगर ($ stmt- & gt; num_rows & gt; 0) {// उपयोगकर्ता का आईडी पुनर्प्राप्त करें}  

मैं यह जानना चाहता हूं कि उपयोगकर्ता मौजूद है या नहीं और उसका आईडी चुनें। मैंने पहली बार किया, कैसे अपनी पहचान प्राप्त कर सकते हैं? पंक्ति परिणाम के माध्यम से पाश? या मुझे एक और एसक्यूएल लिखना है? मुझे store_result () और get_result () के साथ भी भ्रमित हूं।

मुझे लगता है कि आपको अपना परिणाम प्राप्त करना चाहिए

  $ stmt = $ db- & gt; तैयार करें ("चयन करें * उपयोगकर्ता से कहां नाम =?") का पालन करने के लिए क्वेरी को क्रियान्वित करने के बाद; $ Stmt-> gt; bind_param ('s', $ username); $ Stmt- & gt; निष्पादित (); अगर ($ stmt- & gt; num_rows & gt; 0) {$ row = $ stmt- & gt; फ़ेच_अरे () print_r ($ पंक्ति); }  

Comments

Popular posts from this blog

javascript - How to use the code plugin with popcornjs -

Apache Redirect Performance - .htaccess vs Apache configuration file ? -