Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> wyrażenia regularne - parsowanie zapytan mysql'a
ppp
post
Post #1





Grupa: Zarejestrowani
Postów: 33
Pomógł: 3
Dołączył: 29.01.2008

Ostrzeżenie: (0%)
-----


witam,
potrzebowałbym jakiejs sugestii jak sparsować dowolne (no może nie do końca dowolne bo selecta) zapytanie do mysqla tak zeby móc do niego dolozyc jakis warunek dodatkowy.
Powiedzmy ze mam takie zapytania
  1. <?php
  2. $sql = "select * from table where field1 = 'value'";
  3. $sql2 = "select * from table left join table2 on table.id=table2.table_id";
  4. $sql3 = "select * from table order by field1 desc";
  5. $sql4 = "select * from table where (field1 = 'value1' or field2 = 'value2) group by field3";
  6. ?>

i do wszystkich chcialbym dolozyc warunek field3='value3' zeby bylo
  1. <?php
  2. $sql = "select * from table where field1 = 'value' and field3='value3'";
  3. $sql2 = "select * from table left join table2 on table.id=table2.table_id where fiel
    d3='value3'"
    ;
  4. $sql3 = "select * from table where field3='value3' order by field1 desc";
  5. $sql4 = "select * from table where (field1 = 'value1' or field2 = 'value2) and field3='value3' group by field3";
  6. ?>

mam nadzieje ze wiadomo o co chodzi.
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 25.08.2025 - 15:59