Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

174
Views
php functions and mysqli
<?php
select1($conn); 
function select2 ($conn,$id ,$name)
{   
    $stmt = $conn->prepare("SELECT def FROM define WHERE wordkey = ?");
    mysqli_stmt_bind_param($stmt, 'i', $id);
    $stmt->execute(); 
    $stmt->bind_result($def);
    while($stmt->fetch()) {
        echo "here"; // for testing
        $wordArray += $def; 
        //I will make a call to the js function here sending id, name and wordArray
    }  
    //$stmt->close();
}

function select1 ($conn){
    $stmt2 = $conn->prepare("SELECT id , name FROM words");
    $stmt2->execute(); 
    $stmt2->bind_result($id, $name);
    while($stmt2->fetch()) {
        select2 ($conn,$id ,$name);
    }
}
?>

I want to ask question I have words table and def table. in def table i have multiple definitions for the same words.id. Is it possible to select them in one query statement ?

words table have

id , name 

def table have

id, wordkey , definition

I want to retrieve name and for each name select all its definitions so that I will then call a javascript function (id, name, defArray) to display each name with the array of its definitions. I thought of doing it through 2 select statement, but the problem is the select2 function is not working. Please Help!

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!