Click here to Skip to main content
15,891,423 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to translate the following Query in PHP language Syntax Please help me

SQL
SELECT dealerprice.product FROM dealerprice WHERE product not in (SELECT
productdetail_idproductdetail FROM Dpmix_Has_Productdetail1)



I able to write this Query directly,it cn be loaded somewhat like $objpttt = Dealerprice::LoadAll(
QQ::OrderBy(
QQ::NotEqual(QQN::Dealerprice()->Product,DpmixHasProductdetail1()->ProductdetailIdproductdetail)));
Posted

What you'd do is simply:
PHP
$tsql = "SELECT dealerprice.product FROM dealerprice WHERE product not in (SELECT productdetail_idproductdetail FROM Dpmix_Has_Productdetail1)";


It's what comes next that you need to consider.

You need to do the following (in php):
1) Establish a connection to a database
2) Execute the query
3) Retrieve the rowset(s) - if any, that are returned
4) Make use of the rowset data, depending on what you're planning to do with this

MySQL is usually included with any php package (the 'P' in LAMP).
If it's a SQL database, you need to get the .php drivers (free from Microsoft)

As to how to create the queries, you should get yourself a good php reference.

A very simple one: http://www.w3schools.com/php/php_mysql_intro.asp[^]
 
Share this answer
 
Comments
CPallini 26-Dec-13 15:38pm    
5.However:
- MySQL is included in any LAMP package (it is the 'M' of course), not in PHP ones.
- Many databases are 'SQL' databases, the Microsoft one is called 'SQL Server'.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900