Name of user in question
This commit is contained in:
parent
9247804208
commit
30bc7ac4dc
9
user.php
9
user.php
|
@ -6,10 +6,6 @@ if(!$user || !$user["id"]){
|
||||||
include("404.php");
|
include("404.php");
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
//else if(!$user["id"]){
|
|
||||||
// include("404.php");
|
|
||||||
// die();
|
|
||||||
//}
|
|
||||||
|
|
||||||
$db->exec("CREATE TABLE IF NOT EXISTS questions(
|
$db->exec("CREATE TABLE IF NOT EXISTS questions(
|
||||||
id INTEGER PRIMARY KEY,
|
id INTEGER PRIMARY KEY,
|
||||||
|
@ -60,9 +56,12 @@ if(isset($_POST["post-submit"])){
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
$u_prep = $db->prepare("SELECT * FROM users WHERE id = :id");
|
||||||
$qs = $db->query("SELECT * FROM questions WHERE user = '" . $user["id"] . "' LIMIT 0, 10;");
|
$qs = $db->query("SELECT * FROM questions WHERE user = '" . $user["id"] . "' LIMIT 0, 10;");
|
||||||
while($current = $qs->fetchArray(SQLITE3_ASSOC)){
|
while($current = $qs->fetchArray(SQLITE3_ASSOC)){
|
||||||
echo("<h3>". $current["by"] ."</h3>");
|
$u_prep->bindValue(":id", $current["by"], SQLITE3_INTEGER);
|
||||||
|
$q_user = $u_prep->execute()->fetchArray(SQLITE3_ASSOC);
|
||||||
|
echo("<h3>". $q_user["name"] ."</h3>");
|
||||||
echo("<p>". $current["question"] ."<p>");
|
echo("<p>". $current["question"] ."<p>");
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in New Issue