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 in PHP by Kichu
• 17,230 points
24 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
2,670 views
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,680 points
4,546 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,680 points
200 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,680 points
1,903 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,680 points
163 views
0 votes
1 answer

How to convert a string to JSON object in PHP?

Hello @kartik, it seems that your JSON is ...READ MORE

answered Oct 20, 2020 in PHP by Niroj
• 82,680 points
1,981 views
0 votes
1 answer
0 votes
0 answers
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 in PHP by Kichu
• 17,230 points
12 views
0 votes
0 answers
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP