Jump to content

Andreycon

Members
  • Content Count

    11
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Andreycon

  • Rank
    Member
  1. I checked the code again and saw the problem. I was adding 1 to $Mark to get $Correct. So if $Mark == 1, $Correct == 2...
  2. n applying conditions. So i have 2 files. update.php and home.php. home.php is my html form page and i included 'update.php' in it In my update.php, i have these codes <?php error_reporting(E_ALL); include_once('database.php'); if(isset($_POST['submit'])) { $q = $_GET['q']; $next = $q + 1; if($q == 26) { echo '<h2>You have Completed the Exam.Congrats!!</h2>'; } elseif($q <= 25){ $sql = "SELECT * FROM Students WHERE Email=?"; $stmt = $conn->prepare($sql); $stmt->bind_param('s', $_SESSION['login']); $stmt->execute(); $result = $stmt->get_result(
  3. I am playing around with php but the script doesnt execute to the last point and with no error... What i am trying to do is checking the input of the user and comparing it what is in db and then applying conditions. So i have 2 files. update.php and home.php. home.php is my html form page and i included 'update.php' in it In my update.php, i have these codes <?php error_reporting(E_ALL); include_once('database.php'); if(isset($_POST['submit'])) { $q = $_GET['q']; $next = $q + 1; if($q == 26) { echo '<h2>You have Completed the Exam.Congrats
  4. I got a response from an api in json. How do i echo out the account_name in string. Thanks as usual. The response is below... { "status": true, "message": "Account number resolved", "data": { "account_number": "2067483918", "account_name": "BABALOLA MAYOWA ABEL", "bank_id": 18 } } "status": true, "message": "Account number resolved", "data": { "account_number": "2067483918", "account_name": "BABALOLA MAYOWA ABEL", "bank_id": 18 } }
  5. Tanx all. I got an approach which now works echo "<table>"; foreach ($rowB as $row) { echo "<tr>"; foreach ($row as $column) { echo "<td>$column</td>"; } echo "</tr>"; } echo "</table>";
  6. The $id is its name. So am indexing it with the name. It finds it but only output the first row but if I print $rowB I get all the rows for stone cold in arrays though
  7. Let's assume this is my table Name Amount Gender Stone Cold. 1245. Male Kingsley. 500 Male. Stone Cold 2367 Male Stone Cold. 5678. Male Now I want to print stone cold rows. Which is row 1,3 and 4 just exactly the same format with he above table. How do I get to do that. My code is <?php $id = $_SESSION['login']; $sqlB = "SELECT * FROM activities WHERE username=? ORDER BY No DESC LIMIT 10"; $stmtB = $conn
  8. I want to fetch data from a table let's say table "activities". Uid | day | activity | time | remarks 1. Mon. Act1. 3pm. Good 2. Mon. Act1. 5pm. Bad 1. Tue. Act2. 12am. Bad 1. Tue. Act5. 1am. Bad 1. Thur. Act8. 9pm. Good 2. Wed. Act4. 7am. Good Now assuming I want to fetch all the data that is related to user Id 1 and display them in another table (Uid 1). Which is 4 rows according to the table, how do I go about it using select query? Thanks!
  9. Am a newbie in php. Since I can't insert values to the database with respect to a user Id or with any other token using WHERE clause. I.e "INSERT INTO receipts(date) VALUES(example) where id="**....." If I need to fetch several values of column for a particular user, how do I go about it? Thank you!!!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.