Welcome Guest, Not a member yet? Register   Sign In
Help with Index and Mysqli error
#1

Hey again Blush 

I got these 2 errors and wanted to see how to fix them:

1.
Severity: Notice

Message: Undefined index: email

2.
Severity: Warning

Message: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given



For these lines of code:
$email=$_SESSION['email'];
$sql1="select * from users where user_email='$email'";
$run=mysqli_query($con,$sql1);
echo "<h1>List of friends</h2>";
while($row=mysqli_fetch_array($run))
{
 $id=$row['id'];
$sql="select * from friend where receive_request='$id' and status='1'";
$run1=mysqli_query($con,$sql);
while($row1=mysqli_fetch_array($run1))
{
    $name=$row1['request_sent'];
    $sql2="select * from users where user_email='$name'";
    $run2=mysqli_query($con,$sql2);
    while($row2=mysqli_fetch_array($run2))
    {
        $namee=$row2['user_name'];
        echo $namee."<br/>";
    }

How to fix these? Thank ya kindly

Heart Heart ,
Mekaboo
Reply
#2

Why do you keep using old php code?

If you need to use old code convert it to CodeIgniter.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

(06-29-2019, 08:52 AM)InsiteFX Wrote: Why do you keep using old php code?

If you need to use old code convert it to CodeIgniter.

Im using code that I became interested in form Git. This was a repo for a friend's list (like in FB) that caught my eye. The situation is that I cant find many current tutorials pertaining to what I want that deals with CI. Will work on conversion for CI Smile

https://github.com/Ashyamkhan/Friend-Req...g-Core-PHP
Reply
#4

It's full of security holes, you need to rewrite it from scratch.
Reply
#5

The $_session['email'] does not exist find out why there is no $_session['email'] and it should fix your second problem
Reply
#6

Most likely it is a facebook style time lime not a list.

Look for a facebook style time line code for CodeIgniter.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB