Jump to content

Search the Community

Showing results for tags 'php mysql join'.

  • 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 2 results

  1. spertuit

    MySQL Join

    Can anyone give me a hand turning this into a join statement? $query1 = sprintf("SELECT * FROM companies WHERE status = 1"); $result1 = mysql_query($query1); while ($row1 = mysql_fetch_assoc($result1)) { $C1=$row1["companyName"]; $C3=$row1["id"]; $C4=$row1["businessType"]; $query="SELECT * FROM companyAdmins WHERE companyID = '$C3'"; $result=mysql_query($query); $num=mysql_numrows($result); $email=mysql_result($result,0,"email"); echo '<p>' . $C1 . ' @ ' . $email . '</p>'; } Im trying to select companyName,id, and business type from the companies table where the status is one and I'm also trying to select the email from the companyAdmins table where the companyID is equal to the id from the companies table. I want to basically get companyName.companies, id.companies, businessType.companies, and email.companyAdmins I have this file written and now I'm trying to go back and refactor the code and make everything cleaner.
  2. Hello there. =] I have a simple question, which doesn't need any posting of code. I would like to use a PHP MySQL JOIN statement, or whatever it is called. I know it is called a JOIN, and would like to know something about it. My question is: Do two of the rows that you want to combine have to be the same exact name.. or can they have different row names? I actually have THREE tables, but will try to find a way to do this if JOIN can only involve two tables. 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.