Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 31999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T13:41:36+00:00 2026-05-10T13:41:36+00:00

What is the quickest way to get a large amount of data (think golf)

  • 0

What is the quickest way to get a large amount of data (think golf) and the most efficient (think performance) to get a large amount of data from a MySQL database to a session without having to continue doing what I already have:

$sql = 'SELECT * FROM users WHERE username='' . mysql_escape_string($_POST['username']) . '' AND password='' . mysql_escape_string(md5($_POST['password'])) . '''; $result = mysql_query($sql, $link) or die('There was an error while trying to get your information.\n<!--\n' . mysql_error($link) . '\n-->'); if(mysql_num_rows($result) < 1)  {     $_SESSION['username'] = $_POST['username'];     redirect('index.php?p=signup');  } $_SESSION['id'] = mysql_result($result, '0', 'id'); $_SESSION['fName'] = mysql_result($result, '0', 'fName'); $_SESSION['lName'] = mysql_result($result, '0', 'lName'); ... 

And before anyone asks yes I do really need to ‘SELECT

Edit: Yes, I am sanitizing the data, so that there can be no SQL injection, that is further up in the code.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T13:41:36+00:00Added an answer on May 10, 2026 at 1:41 pm

    I came up with this and it appears to work.

    while($row = mysql_fetch_assoc($result))  {     $_SESSION = array_merge_recursive($_SESSION, $row);  } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What is the quickest way to get from the following list: set.seed(1) mylist <-
I'm looking for the quickest/shortest way to get the first value from comma separated
Using the standard Java libraries, what is the quickest way to get from the
I have an NSURL: serverCall?x=a&y=b&z=c What is the quickest and most efficient way to
Which is the quickest way to check the presence of Struts runtime from a
Exploring a new data set: What is the easiest, quickest way to visualise many
Can you please let me know on the quickest and efficient way to compare
What's the quickest and easiest way to get the Min (or Max) value between
I am wondering, which is the best and quickest way to get the well
What is the quickest way in ColdFusion to get first and last day of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.