Object of class mysqli result could not be converted to string

0 votes

Code:

$result = mysqli_query($con, "SELECT classtype FROM learn_users WHERE username='abcde'");

echo "my result <a href='data/$result.php'>My account</a>";

I am getting this error when I run the above code:

Object of class mysqli_result could not be converted to string

How can I solve this?

May 15, 2022 in PHP by Kichu
• 19,050 points
1,299 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In PHP

0 votes
1 answer

How to resolve “must be an instance of string, string given” prior to PHP 7?

Hello, Prior to PHP 7 type hinting can only be ...READ MORE

answered Apr 20, 2020 in PHP by I Navin
• 220 points
4,579 views
0 votes
0 answers
0 votes
1 answer

How to check if a string is JSON or not?

Hello @kartik, Use JSON.parse function isJson(str) { ...READ MORE

answered Aug 19, 2020 in PHP by Niroj
• 82,880 points
8,371 views
0 votes
1 answer

How can I capture the result of var_dump to a string?

Hello @kartik, Try var_export You may want to check out var_export — ...READ MORE

answered Sep 16, 2020 in PHP by Niroj
• 82,880 points
944 views
0 votes
1 answer

How to check whether property exists in object or class in php?

Hello @kartik, Using  property_exists( mixed $class , string $property ...READ MORE

answered Oct 1, 2020 in PHP by Niroj
• 82,880 points
5,597 views
0 votes
1 answer

How to prevent my site page to be loaded via 3rd party site frame of iFrame?

Hello @kartik, You cannot check it from the ...READ MORE

answered Oct 19, 2020 in PHP by Niroj
• 82,880 points
980 views
0 votes
1 answer
0 votes
1 answer

mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in.

The issue is that the query given to mysqli_query() is ...READ MORE

answered May 1, 2022 in Other DevOps Questions by narikkadan
• 63,420 points
1,310 views
0 votes
0 answers

Warning: mysqli_query() expects at least 2 parameters, 1 given. What?

I have to build a PHP page ...READ MORE

May 12, 2022 in PHP by Kichu
• 19,050 points
1,031 views
0 votes
0 answers
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP