How to fix this query, php?

An error occurs and no display "Notice: Undefined index: name in..."
$query=mysqli_query($conn,"SELECT * FROM addhistory");
$numrows=mysqli_num_rows($query);
$row1=mysqli_fetch_all($query);
foreach ($row1 as $row)
{
$sql1=("SELECT name FROM pregister WHERE id='".$row['name']."' ");
$write1 =mysqli_query($conn,$sql1);
//print_r($sql); exit;
$row1=mysqli_fetch_array($write1);
//print_r($row1); exit;
//echo "$description"; exit();
?>
Answer
Solution:
PHP'sfetch_array
returns an array, not an associative array. userfetch_assoc
to get an aassociative array.
if you want tomysqli_fetch_all()
get to use associative arrays, also provideMYSQLI_ASSOC
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: your lock file does not contain a compatible set of packages. please run composer update.
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.