Jump to content

Help with MYSQL and getting records by id


jbwebdesign

Recommended Posts

Hey stephan, To answer your question about what I did to fix my problem,.........

 

<?php

//===============================================

//CONNECT TO MY DATABASE AND SELECT MY DATABASE

$con = mysql_connect('localhost','root','');

$sel = mysql_select_db('calendar');

//===============================================

//DEFINE VARIABLES FOR MYSQL ROWS

$id = $_GET['ff_id'];

$get_record = $_GET['get_records'];

 

if(isset($get_record)){

echo $my_rows;

}

 

//BUILD MY QUERY

$Q = "SELECT * FROM ps69_school_registration WHERE ff_id = '$id'";

$res = mysql_query($Q);

$my_rows;

 

//NOW I WILL CREATE A LOOP COMMAND

while($row = mysql_fetch_array($res,MYSQL_ASSOC)){

$my_rows = $my_rows . '

Student id: ' . $row['ff_id'] . '

Student Name: ' . $row['Student_full_name'] . '

Route Number: ' . $row['Route_number'] . '

Begining Service Date: ' . $row['Begining_service_date'] . '

' . ' ';

}

 

?>

 

student id:

<?php

echo $my_rows;

?>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...