Jump to content

Search the Community

Showing results for tags 'query database'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. Hi, I'm using the following code to grab a csv file from one website & keep it on my website. The code is working fine. <?php $url = 'http://thewebsite.com/export.aspx?type=csv&report=nameofthereport~8~'; $path = '/home/path/to/mywebsite.com/public_ftp/incoming/nameofthereport_Area_8.csv'; $fp = fopen($path, 'w'); $ch = curl_init($url); curl_setopt($ch, CURLOPT_FILE, $fp); $data = curl_exec($ch); curl_close($ch); fclose($fp); ?> Here's what I want to do next. I want to query a database, and replace nameofthereport and 8 with the results of the query. My code to query the database is below. <?php include("/home/path/to/mywebsite.com/public_html/db_connect.php"); //connect to the database $today = date('Y-m-d'); $query1=("SELECT * FROM `table_name` WHERE expiry > $today"); $result1=mysqli_query($GLOBALS["___mysqli_ston"], $query1); $num1=mysqli_num_rows($result1); if ($num1 > 0) { while ($data = mysqli_fetch_array($result1)){ $email_to = $data["email"]; $district = $data["district"]; $report = $data["report"]; } } ?> Based on the code above, I would like to replace nameofthereport with $report and 8 with $district Could you show me the code please? Thanks.
×
×
  • 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.