[PHP-DB] chmod

2013-08-19 Thread Emiliano Boragina
Hello everyone,
I try to use chmod 0777, but the JPG file in my localhost I cant view.
I must enter in the windows properties of the JPG file, add the user with
full permission, and them i can view it.
I use this:
move_uploaded_file($file_tmp,$desired_dir/.$file_name);
chmod($desired_dir/.$file_name,0777);
What's wrong?
Thanks. Emiliano


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Re: filter search

2011-04-20 Thread Emiliano Boragina
Jim, thanks for your help...
I send because the first emial was replied saying to send again to see if I
am a spamer...
Thanks again.

2011/4/20 Jim Giner jim.gi...@albanyhandball.com

  oh - and by the way - don't email people directly.  We are all reading
 the list, so send your mail to the list and not to everybody as well.




-- 

--
Emiliano Boragina
desarrollos + comunicación
--
+ 15 33 92 60 02
» emiliano.borag...@gmail.com
--
© 2011
--


[PHP-DB] filter search

2011-04-18 Thread Emiliano Boragina
Hello,

I have an mysql database, with columns: id, name, day, month, year (this
last three birthdate), city,
I must to do a finder with filter.
This finder (or searcher) must can filter three thing: name, city and age.

I understand to do a finder with LIKE.
But I dont understand how or what I must to do to add the AND conditional,
and the WHERE.

I can do: query = SELECT * FROM mydatabase WHERE name LIKE '%keyword%' AND
city LIKE '%keyword%' ORDER BY id DESC

I dont know how to do the AGE part and the conditionals AND if the user can
search one or two or three filters.

Thanks a lot.

-- 

--
Emiliano Boragina
desarrollos + comunicación
--
+ 15 33 92 60 02
» emiliano.borag...@gmail.com
--
© 2011
--


[PHP-DB] products order

2010-09-29 Thread Emiliano Boragina
Hello,

A client wants to control the order, the position of the products he
load. How do I do this?

Thanks a lot.

--
Emiliano Boragina
desarrollos + comunicación
--
+ 15 33 92 60 02
» emiliano.borag...@gmail.com
--
© 2010
--



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] table html with PHP

2010-06-15 Thread Emiliano Boragina
Hello everyone,

I need to know how do I do a two columns table with a register per cell.

table
tr
?php
$i = 0;
while(array)
{
echo td$varible[0]/td;
}
j++
if j  2
echo /tr
?
/table

this dont work very well.
Thanks a lot


Re: [PHP-DB] table html with PHP

2010-06-15 Thread Emiliano Boragina
sorry... why $i = 0 again?

2010/6/15 Systems syst...@3dgtech.com

 I assume you're looking for something like:
 table
tr
?php
$i = 0;
while(array)
{
echo td$varible[0]/td;
 $i++;
If ($i1)
 {
$i=0;
echo '/trtr';
}
}
   ?
/tr
 /table

 -Original Message-
 From: Emiliano Boragina [mailto:emiliano.borag...@gmail.com]
 Sent: Tuesday, June 15, 2010 3:21 PM
 To: php-db@lists.php.net
 Subject: [PHP-DB] table html with PHP

 Hello everyone,

 I need to know how do I do a two columns table with a register per cell.

 table
 tr
 ?php
 $i = 0;
 while(array)
 {
 echo td$varible[0]/td;
 }
 j++
 if j  2
 echo /tr
 ?
 /table

 this dont work very well.
 Thanks a lot




Re: [PHP-DB] table html with PHP

2010-06-15 Thread Emiliano Boragina
sorry again... thanks for your answer...

2010/6/15 Emiliano Boragina emiliano.borag...@gmail.com

 sorry... why $i = 0 again?

 2010/6/15 Systems syst...@3dgtech.com

 I assume you're looking for something like:
 table
tr
?php
$i = 0;
while(array)
{
echo td$varible[0]/td;
 $i++;
If ($i1)
 {
$i=0;
echo '/trtr';
}
}
   ?
/tr
 /table

 -Original Message-
 From: Emiliano Boragina [mailto:emiliano.borag...@gmail.com]
 Sent: Tuesday, June 15, 2010 3:21 PM
 To: php-db@lists.php.net
 Subject: [PHP-DB] table html with PHP

 Hello everyone,

 I need to know how do I do a two columns table with a register per cell.

 table
 tr
 ?php
 $i = 0;
 while(array)
 {
 echo td$varible[0]/td;
 }
 j++
 if j  2
 echo /tr
 ?
 /table

 this dont work very well.
 Thanks a lot





Re: [PHP-DB] table html with PHP

2010-06-15 Thread Emiliano Boragina
thank youu... work... I understand why the $i = 0 again... thanks thanks
thanks

2010/6/15 Systems syst...@3dgtech.com

 I assume you're looking for something like:
 table
tr
?php
$i = 0;
while(array)
{
echo td$varible[0]/td;
 $i++;
If ($i1)
 {
$i=0;
echo '/trtr';
}
}
   ?
/tr
 /table

 -Original Message-
 From: Emiliano Boragina [mailto:emiliano.borag...@gmail.com]
 Sent: Tuesday, June 15, 2010 3:21 PM
 To: php-db@lists.php.net
 Subject: [PHP-DB] table html with PHP

 Hello everyone,

 I need to know how do I do a two columns table with a register per cell.

 table
 tr
 ?php
 $i = 0;
 while(array)
 {
 echo td$varible[0]/td;
 }
 j++
 if j  2
 echo /tr
 ?
 /table

 this dont work very well.
 Thanks a lot




[PHP-DB] upload images

2010-05-30 Thread Emiliano Boragina
Hello, I want to do an Admin to upload more than one picture per clic, I
must can upload one or more Pictures. This I know how is it... but I want
rename each picture, not with , for example, 001 but with some function,
some... thing that rename the file. I am using this:

if(isset($_POST['submit'])){
$error = false;
// si hay imagen.
if (is_uploaded_file($_FILES['foto']['tmp_name'])) {
//revisamos que sea jpg
if ($_FILES['foto']['type'] == image/jpeg ||
$_FILES['foto']['type'] == image/pjpeg){
//nombre de la imagen
$foto = time()..jpg;
//movemos la imagen.
move_uploaded_file($_FILES['foto']['tmp_name'],
../fotografias/.$foto);
}else{
$error = true;
$errormsg = Formato no válido para archivo de
imagen;
}
} else {
//imagen no se pudo subir o no seleccionaron.
$error=true;
$errormsg = Error al cargar imagen:  .
$_FILES['foto']['name'];
}//fin file upload.

//continuamos con el insert.
//si hay error no hay imagen.
if($error){
$foto = ;
}

$titulo = $_POST['titulo'];
$texto = $_POST['texto'];
$categoria = $_POST['categoria'];
$habilitar = $_POST['habilitar'];
$campos = titulo,texto,foto,categoria,habilitar;
$valores = '$titulo','$texto','$foto','$categoria','$habilitar';
//nos conectamos a la bd.
$cnx = conectar();
$res = mysql_query(INSERT INTO registros ($campos)
VALUES($valores)) or die (mysql_error());
//cerramos la conexión.
mysql_close($cnx);
//mensaje de exito.
$mensaje = El registro ha sido ingresado;
exit;
}

?

If you can help me... I thanks a lot... If not... I thanks a lot anyway =D
Best regards!

--
Emiliano Boragina
desarrollos + comunicación
--
+ 15 33 92 60 02
» emiliano.borag...@gmail.com
--
© 2010
--



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] upload multiple files and rename wih time()

2010-02-06 Thread Emiliano Boragina
Hello php fellows,

 

I have two codes to upload multiple files, works very well, but I cant
rename the files... really i dont know...

CODE1:

 

$uploadfile = $uploaddir . basename($_FILES[fotog][name][$key]); 


  if (is_uploaded_file($_FILES['fotog']['tmp_name'][$key]))  


  { 


 //revisamos que sea jpg 


 if ($_FILES['fotog']['type'][$key] == image/jpeg ||
$_FILES['fotog']['type'][$key] == image/pjpeg) 


 { 


//nombre de la imagen 


$fotog = time()..jpg;; 


//movemos la imagen. 


move_uploaded_file($_FILES['fotog']['tmp_name'][$key],
../originales/.$fotog); 


 }else{ 


$error = true; 


$errormsg = Formato no válido para archivo de imagen; 


 } 


  } else { 


 //imagen no se pudo subir o no seleccionaron. 


 $error=true; 


 $errormsg = Error al cargar imagen:  .
$_FILES['fotog']['name'][$key]; 


  }//fin file upload. 


  


  //continuamos con el insert. 


  //si hay error no hay imagen. 


  if($error){ 


 $fotog = N/A; 


  }

and CODE2:

 

$uploadfile = $uploaddir . basename($_FILES[fotog][name][$key]);  


  //echo $uploadfile; 


  if (move_uploaded_file($_FILES['fotog']['tmp_name'][$key],
$uploadfile))  


  {  


 echo $value . ' uploadedbr'; 


  }

 

How can I do this?

Thanks a lot,

 

 

+ +
   Emiliano Boragina | Diseño  Comunicación
   emiliano.borag...@gmail.com  | 15 33 92 60 02
+ +

 



[PHP-DB] UPDATE lot of registers

2009-10-19 Thread Emiliano Boragina
Hello everyone…

 

I dont know how to update a lot of registers on one table.

 

I have two tables: Students and Signatures

 

STUDENTS has got: id / name / signature

SIGNATURES has got: id / name / classroom

 

I want to use words and not numbers to write the signature on the STUDENTS
table.

I’ve got a long list with signatures, and I must to change one signature...
How do I do update SIGNATURE AND STUDENTS tables o sam time if 100 students
has got the same signature and must update automatically?

 

Thanks a lot

 

+  _
   // Emiliano Boragina _
   // Diseño  Comunicación //
+  _
   // emiliano.borag...@gmail.com  /
   // 15 40 58 60 02 ///
+  _

 



Re: [PHP-DB] Search

2009-10-16 Thread Emiliano Boragina
Hello jack...

Is like you say... the ID in each table is not the same.
cupones.empresas is an INT field with the empresas.id number, the same with
rubros... for that reason I do that... I will try your solution, for me is
not e good solution that code I type too, but dont know how work with two or
mor tables yet..

Thanks

2009/10/16 Jack van Zanen j...@vanzanen.com

 For starters try this

 FROM cupones
 INNER JOIN empresas ON (empresas.id =cupones.empresa)
 INNER JOIN rubros ON (rubros.id = cupones.rubro)

 I am not sure about the join criteria you have given us, they look a bit
 suss to me. What is the field/are the fields that join the tables?

 I would imagine the joining should be on the ID field that is present in
 all three tables, but the ID may not be the same meaning for the tables.


 Jack



 2009/10/16 Emiliano Boragina emiliano.borag...@gmail.com

  Hello
 I’m using this code to a search:

 $sql = SELECT empresas.id, empresas.nombre, rubros.id, rubros.nombre,
 cupones.empresa, cupones.rubro, cupones.titulo, cupones.descripcion FROM
 cupones INNER JOIN empresas INNER JOIN rubros ON (empresas.id =
 cupones.empresa OR rubros.id = cupones.rubro) WHERE (empresas.nombre LIKE
 '%$_GET[busqueda]%' OR rubros.nombre LIKE '%$_GET[busqueda]%' OR
 cupones.titulo LIKE '%$_GET[busqueda]%' OR cupones.descripcion LIKE
 '%$_GET[busqueda]%');

 I have a input text with name “clave”.
 I have three tables: empresas, rubros anda cupones.
 The “empresa” table has got ID and NOMBRE The “rubro” table has got ID and
 NOMBRE And the “cupones” table has got ID (from the coupon), EMPRESA
 (int),
 RUBRO (int) , TITULO, DESCRIPCION

 The client has got 100 coupons (CUPONES table) in the data base.
 He wants to search in any of these fields, but with tath code the search
 return 200 or 1000 results.

 If the total of coupons are 100, what should I do to the searching return
 only one time the coupon with the keyword insert to search...
 Thanks a lot


 +
 _
// Emiliano Boragina _
// Diseño  Comunicación //
 +
 _
// emiliano.borag...@gmail.com  /
// 15 40 58 60 02 ///
 +
 _



 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




 --
 Jack van Zanen

 -
 This e-mail and any attachments may contain confidential material for the
 sole use of the intended recipient. If you are not the intended recipient,
 please be aware that any disclosure, copying, distribution or use of this
 e-mail or any attachment is prohibited. If you have received this e-mail in
 error, please contact the sender and delete all copies.
 Thank you for your cooperation




-- 
+_
  Emiliano Boragina //
  Diseño y Comunicación /
+_
  emiliano.borag...@gmail.com 
  15 40 58 60 02 //
+_


[PHP-DB] Search

2009-10-15 Thread Emiliano Boragina
Hello
I’m using this code to a search:

$sql = SELECT empresas.id, empresas.nombre, rubros.id, rubros.nombre,
cupones.empresa, cupones.rubro, cupones.titulo, cupones.descripcion FROM
cupones INNER JOIN empresas INNER JOIN rubros ON (empresas.id =
cupones.empresa OR rubros.id = cupones.rubro) WHERE (empresas.nombre LIKE
'%$_GET[busqueda]%' OR rubros.nombre LIKE '%$_GET[busqueda]%' OR
cupones.titulo LIKE '%$_GET[busqueda]%' OR cupones.descripcion LIKE
'%$_GET[busqueda]%');

I have a input text with name “clave”.
I have three tables: empresas, rubros anda cupones.
The “empresa” table has got ID and NOMBRE The “rubro” table has got ID and
NOMBRE And the “cupones” table has got ID (from the coupon), EMPRESA (int),
RUBRO (int) , TITULO, DESCRIPCION

The client has got 100 coupons (CUPONES table) in the data base.
He wants to search in any of these fields, but with tath code the search
return 200 or 1000 results.

If the total of coupons are 100, what should I do to the searching return
only one time the coupon with the keyword insert to search...
Thanks a lot


+      _
   // Emiliano Boragina _
   // Diseño  Comunicación //
+      _
   // emiliano.borag...@gmail.com  /
   // 15 40 58 60 02 ///
+      _



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] one input, much mails, insert each mail in one register

2009-09-24 Thread Emiliano Boragina
Hi…

Thanks to Vinay for your help… works very good...

But I can’t validate if one or more of the emails insert in the textarea
exist in the table of the DB to not insert it, but yes insert the others
mails that not exist in the db.

This the cod:

 

html

head

titleExplode trial/title/head

body

?php

if($_GET['emailreader'])

{

 $username=root;

 $password=root;

 $database=anda;

 $con = mysql_connect(localhost,$username,$password);

 mysql_select_db($database, $con);

 $str = $_GET['emailreader'];

 $text=$_GET['emailreader'];

 $spacecount=substr_count($text, );

 $emails_exploded=(explode( ,$str));

 

 $sql = SELECT * FROM mailing;

 $result = mysql_query($sql);

 $array = mysql_fetch_array($result);

 $mail = $array['mail'];

 

 for ($i=0;$i=$spacecount;$i++)

   {

   if($emails_exploded[$i] != $mail)

   {

echo $emails_exploded[$i];

mysql_query(INSERT INTO mailing (mail)
VALUES('$emails_exploded[$i]')) or die(mysql_error());

   }

 }

}

  

?

form action=?php $_SERVER['PHP_SELF'] ? method=get name=emailform

label for=emailEmail/label

input type=text name=emailreader size=200 /

input type=submit name=submit value=Ok ! /

input type=hidden name=trigger value=6 /

input type=reset name=cancel value=Cancel /

/form

/body

/html

 

Thanks a lot

 

+  _
   // Emiliano Boragina _
   // Diseño  Comunicación //
+  _
   // emiliano.borag...@gmail.com  /
   // 15 40 58 60 02 ///
+  _

 



[PHP-DB] more than one mail separate with comma or space insert one register for each mail

2009-09-23 Thread Emiliano Boragina
Hello…

 

I must do a form with only one input text.

In this the client want to write more than one mail, separte with comma or
white space.

But each mail must be a register in the table in the data base.

How do I do this?

 

+  _
   // Emiliano Boragina _
   // Diseño  Comunicación //
+  _
   // emiliano.borag...@gmail.com  /
   // 15 40 58 60 02 ///
+  _

 



RE: [PHP-DB] more than one mail separate with comma or space insert one register for each mail

2009-09-23 Thread Emiliano Boragina
Thank… but the question is “how” and not “what”... “what” I must do... I
know... dont know “how”

Thanks anyway

 

+  _
   // Emiliano Boragina _
   // Diseño  Comunicación //
+  _
   // emiliano.borag...@gmail.com  /
   // 15 40 58 60 02 ///
+  _

  _  

De: Vinay Kannan [mailto:viny...@gmail.com] 
Enviado el: Miércoles, 23 de Septiembre de 2009 01:02 p.m.
Para: Emiliano Boragina
Asunto: Re: [PHP-DB] more than one mail separate with comma or space insert
one register for each mail

 

use php explode to explode the single string that has either the comma or
white space, save them into variables and update them into the database
table simultaneously.

 

This should work, try looking up the net for PHP explode, I think that
should do it for you.

 

Thanks,

Vinay Kannan.

On Wed, Sep 23, 2009 at 9:21 PM, Emiliano Boragina
emiliano.borag...@gmail.com wrote:

Hello…



I must do a form with only one input text.

In this the client want to write more than one mail, separte with comma or
white space.

But each mail must be a register in the table in the data base.

How do I do this?



+  _
  // Emiliano Boragina _
  // Diseño  Comunicación //
+  _
  // emiliano.borag...@gmail.com  /
  // 15 40 58 60 02 ///
+  _




 



RE: [PHP-DB] more than one mail separate with comma or space insert one register for each mail

2009-09-23 Thread Emiliano Boragina
Sorry Vinay… I dont read right your answer... sorry a lot...

Thank you!

+  _
   // Emiliano Boragina _
   // Diseño  Comunicación //
+  _
   // emiliano.borag...@gmail.com  /
   // 15 40 58 60 02 ///
+  _

  _  

De: Vinay Kannan [mailto:viny...@gmail.com] 
Enviado el: Miércoles, 23 de Septiembre de 2009 01:02 p.m.
Para: Emiliano Boragina
Asunto: Re: [PHP-DB] more than one mail separate with comma or space insert
one register for each mail

 

use php explode to explode the single string that has either the comma or
white space, save them into variables and update them into the database
table simultaneously.

 

This should work, try looking up the net for PHP explode, I think that
should do it for you.

 

Thanks,

Vinay Kannan.

On Wed, Sep 23, 2009 at 9:21 PM, Emiliano Boragina
emiliano.borag...@gmail.com wrote:

Hello…



I must do a form with only one input text.

In this the client want to write more than one mail, separte with comma or
white space.

But each mail must be a register in the table in the data base.

How do I do this?



+  _
  // Emiliano Boragina _
  // Diseño  Comunicación //
+  _
  // emiliano.borag...@gmail.com  /
  // 15 40 58 60 02 ///
+  _




 



[PHP-DB] one input, much mails, insert in db

2009-09-23 Thread Emiliano Boragina
Hello again…

I could explode and/or replace the “, ” for “”.

But how do I get each mail if the client type on the textarea a lot of
mails, and insert in the data base?

I dont understand how use for or for each to do this...

Thanks a lot

+  _
   // Emiliano Boragina _
   // Diseño  Comunicación //
+  _
   // emiliano.borag...@gmail.com  /
   // 15 40 58 60 02 ///
+  _

 



[PHP-DB] switch and while

2009-08-28 Thread Emiliano Boragina
Hello.

I want do a SWITCH using data base MySQL.
The CASE must be a variable, same the ECHO.
My table (CATEGORY) contain ID and NAME

I do this (with a WHILE):

$sqlCat = SELECT * FROM categoria;
$resultCat = mysql_query($sqlCat);

switch ($selectCategory)
{   
while($array=mysql_fetch_array($resultCat))
{
   case $row[0]:
$categoy = $row[1];
break;
}
}

But doesnt works, print an error: Parse error: syntax error, unexpected
T_WHILE, expecting T_CASE or T_DEFAULT or '}' in
C:\AppServ\www\andademiparte\admin\listado.php on line 118... this line is
the WHILE.

How can resolve this?
thanks

+      _
   // Emiliano Boragina _
   // Diseño  Comunicación //
+      _
   // emiliano.borag...@gmail.com  /
   // 15 40 58 60 02 ///
+      _



RE: [PHP-DB] switch and while

2009-08-28 Thread Emiliano Boragina
Thanks Arie…
But I need to do category1 be the ID of my table.
Using this way I have CASE number_ID_table echo string_CATEGORY_FIELD_table,
and will be automatic... Many CASES as ID I having in the database

Thanks again

+      _
   // Emiliano Boragina _
   // Diseño  Comunicación //
+      _
   // emiliano.borag...@gmail.com  /
   // 15 40 58 60 02 ///
+      _

De: Arie Nugraha [mailto:dica...@gmail.com] 
Enviado el: Viernes, 28 de Agosto de 2009 03:13 a.m.
Para: Emiliano Boragina
Asunto: Re: [PHP-DB] switch and while

You have wrong syntax there :

The switch construct is working like this :

?php

switch ($selectCategory) 
{
    case 'category1':
    while ($array=mysql_fetch_array($resultCat)) {
    // do something here
    }
    break;
    case 'category2':
    // do another thing
    break;
}

?

Or maybe what you mean is like this :

while ($row=mysql_fetch_array($resultCat)) {
    switch ($row[0]) {
    case 'category1' :
   // do something here
    break;
    case 'category2' :
    // do something here
    break;
    }
}

On Fri, Aug 28, 2009 at 1:03 PM, Emiliano Boragina
emiliano.borag...@gmail.com wrote:
Hello.

I want do a SWITCH using data base MySQL.
The CASE must be a variable, same the ECHO.
My table (CATEGORY) contain ID and NAME

I do this (with a WHILE):

$sqlCat = SELECT * FROM categoria;
$resultCat = mysql_query($sqlCat);

switch ($selectCategory)
{
       while($array=mysql_fetch_array($resultCat))
       {
      case $row[0]:
               $categoy = $row[1];
               break;
       }
}

But doesnt works, print an error: Parse error: syntax error, unexpected
T_WHILE, expecting T_CASE or T_DEFAULT or '}' in
C:\AppServ\www\andademiparte\admin\listado.php on line 118... this line is
the WHILE.

How can resolve this?
thanks

+      _
   // Emiliano Boragina _
   // Diseño  Comunicación //
+      _
   // emiliano.borag...@gmail.com  /
   // 15 40 58 60 02 ///
+      _



-- 
Open Source is about respecting other people creation and sharing knowledge
to others.
Sebaik baiknya manusia adalah yang bermanfaat bagi orang lain.
http://dicarve.blogspot.com


RE: [PHP-DB] switch and while

2009-08-28 Thread Emiliano Boragina
Hi Chris,
Sorry... you're right!
With this I want to print the category in a html table after a search...
The search find the data, and print category and description. This category
is a number (ID), but I want to print the name of the category. My MYSQL
CATEGORY TABLE have ID and NAME, so using the SWITCH, I want to put in CASE
the ID and ECHO the NAME.
In other webs I do
switch($category) //where $category is an array fom the db
{
case 1:
echo category1;
break;

case 2:
echo category2;
break;

...
}
I want the 1, 2, 3... like the ID from my table, and category1,
category2... like the NAME from my table
Do not know if it was understood...
Thanks again

+  _
   // Emiliano Boragina _
   // Diseño  Comunicación //
+  _
   // emiliano.borag...@gmail.com  /
   // 15 40 58 60 02 ///
+  _

-Mensaje original-
De: Chris [mailto:dmag...@gmail.com] 
Enviado el: Viernes, 28 de Agosto de 2009 03:42 a.m.
Para: Emiliano Boragina
CC: 'Arie Nugraha'; php-db@lists.php.net
Asunto: Re: [PHP-DB] switch and while

Emiliano Boragina wrote:
 Thanks Arie...
 But I need to do category1 be the ID of my table.
 Using this way I have CASE number_ID_table echo
string_CATEGORY_FIELD_table,
 and will be automatic... Many CASES as ID I having in the database

If the $selectCategory is part of the database query, then you need to 
do it like that.

switch ($selectCategory)
{
   case 'category1':
 $query = .;
   break;

   case 'category2':
 $query = .;
   break;
}

You haven't really explained what you're trying to achieve so it's a bit 
hard to suggest anything.

-- 
Postgresql  php tutorials
http://www.designmagick.com/


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] switch and while

2009-08-28 Thread Emiliano Boragina
A retail...
I have two tables in my db.
One for product description, in this one I have the column CATEGORY as INT.
The other table is CATEGORY with ID and NAME of category.

So, I do a select from this two tables... but I need switch the number of
the CATEGORY in the first table to the NAME in the second table.

Thanks a lot

+  _
   // Emiliano Boragina _
   // Diseño  Comunicación //
+  _
   // emiliano.borag...@gmail.com  /
   // 15 40 58 60 02 ///
+  _


-Mensaje original-
De: Chris [mailto:dmag...@gmail.com] 
Enviado el: Viernes, 28 de Agosto de 2009 03:42 a.m.
Para: Emiliano Boragina
CC: 'Arie Nugraha'; php-db@lists.php.net
Asunto: Re: [PHP-DB] switch and while

Emiliano Boragina wrote:
 Thanks Arie...
 But I need to do category1 be the ID of my table.
 Using this way I have CASE number_ID_table echo
string_CATEGORY_FIELD_table,
 and will be automatic... Many CASES as ID I having in the database

If the $selectCategory is part of the database query, then you need to 
do it like that.

switch ($selectCategory)
{
   case 'category1':
 $query = .;
   break;

   case 'category2':
 $query = .;
   break;
}

You haven't really explained what you're trying to achieve so it's a bit 
hard to suggest anything.

-- 
Postgresql  php tutorials
http://www.designmagick.com/


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] WHILE

2009-07-19 Thread Emiliano Boragina
Hello everyone…

 

First, I thank you all for the help on the past week.

I could do the finder... thank you very much.

 

Now... I must print images from the product. But the data about the product
is in a table and the pictures are in other table.

The picture table has 12 columns, the first two are ID and CODE, the rest of
them are picture1, picture2, picture3... picture10.

Can be not always the product has all ten pictures, can be three, one, etc.

I dont know how to use WHILE to print pictures without print ID and CODE
columns.

 

This my code:

 

?

$ID = $_GET['id_PROD'];

$sql = SELECT * FROM picture WHERE id = '$ID';

$result =mysql_query($sql,$conn);

 

while($row_FOTOS=mysql_fetch_row($result))

{

 echo img src='products/$row [3]' border='0' height='384' /;

}

?

 

Thanks

 

+  _
   // Emiliano Boragina _
   // Diseño  Comunicación //
+  _
   // emiliano.borag...@gmail.com  /
   // 15 40 58 60 02 ///
+  _

 



RE: [PHP-DB] finder (I AM REALLY SORRY)

2009-07-17 Thread Emiliano Boragina
Jajajajaja no Yves... really I dont want you for do my job... for that I
said I'm really sorry because I understand what do yo think. I reading and
writing code testing all... I ask for you because not undertand something
complicated like this multifinder... I see a lot of finder tutorials
searching all without selecting data search... I'm thinking I must write
more than 100 lines for particular search, but with the hel of he list I see
not... I do a code with the help of a web... and help from you, list.

Sorry if you think that... but itsnt...
Thanks a lot...

+  _
   // Emiliano Boragina _
   // Diseño  Comunicación //
+  _
   // emiliano.borag...@gmail.com  /
   // 15 40 58 60 02 ///
+  _

-Mensaje original-
De: Yves Sucaet [mailto:yves.suc...@usa.net] 
Enviado el: Viernes, 17 de Julio de 2009 10:08 a.m.
Para: php-db@lists.php.net
Asunto: Re: [PHP-DB] finder (I AM REALLY SORRY)

Hi List,

Am I the only one who's getting the feeling that we're doing Emiliano's JOB 
here? Maybe he should try posting a job opening at his company to this list,

instead of letting us solve all his problems and write his entire 
application for him.

I'm all for helping each other out, but this has just been a stepwise 
build-up of how to write his real-estate application.

Just my two cents,

- Original Message - 
From: Emiliano Boragina emiliano.borag...@gmail.com
To: php-db@lists.php.net
Sent: Friday, July 17, 2009 12:16 AM
Subject: [PHP-DB] finder (I AM REALLY SORRY)


Sorry a lot of times!!!

Please... tell me (and help me) to know if this is right:



?

include conn.php;



$sql = SELECT * FROM principal FULL JOIN detalles FULL JOIN aestrenar FULL
JOIN fotos ON principal.id=detalles.id=aestrenar.id=fotos.id ORDER BY id
ASC;

$result=mysql_query($sql,$conn);

$row=mysql_fetch_row($result);



$f_codigo = $_REQUEST['codigo'];

$f_inmueble = $_REQUEST['inmueble'];

$f_operacion = $_REQUEST['operacion'];

$f_desde = $_REQUEST['fpreciodesde'];

$f_hasta = $_REQUEST['fpreciohasta'];

$f_moneda = $_REQUEST['moneda'];

$f_region = $_REQUEST['region'];

$f_barrio = $_REQUEST['barrio'];

$f_ambientes = $_REQUEST['ambientes'];

$f_dependencia = $_REQUEST['dependencia'];

$f_cochera = $_REQUEST['cochera'];

$f_ubicacion = $_REQUEST['ubicacion'];

$f_apto = $_REQUEST['apto'];



if(($f_desde = 0) || ($f_desde == )) { $f_desde = 0; }

if(($f_hasta = 0) || ($f_hasta == )) { $f_hasta = 0; }

if(($f_ambientes = 0) || ($f_ambientes == )) { $f_ambientes = 0; }

$f_precio = $f_desde = $row['precio'] = $f_hasta;



if($f_codigo == )

{

 $sql_BUSQUEDA = SELECT * FROM principal FULL JOIN detalles WHERE
';

 if ($f_inmueble  0) { $sql_BUSQUEDA .=  inmueble LIKE
'%$f_inmueble%' ; }

 if ($f_operacion  0) { $sql_BUSQUEDA .= AND operacion LIKE
'%$f_operacion%' ; }

 if ($f_precio) { $sql_BUSQUEDA .= AND precio = '$f_precio' ; }

 if ($f_moneda == 1) { $sql_BUSQUEDA .= AND moneda = '$f_moneda' ;
}

 if ($f_moneda == 2) { $sql_BUSQUEDA .= AND moneda = '$f_moneda' ;
}

 if ($f_region  0) { $sql_BUSQUEDA .= AND region LIKE
'%$f_region%' ; }

 if ($f_barrio  0) { $sql_BUSQUEDA .= AND barrio LIKE
'%$f_barrio%' ; }

 if ($f_ambientes  0) { $sql_BUSQUEDA .= AND ambientes LIKE
'%$f_ambientes%' ; }

 if ($f_dependencia  0) { $sql_BUSQUEDA .= AND dependencia LIKE
'%$f_dependencia%' ; }

 if ($f_cochera  0) { $sql_BUSQUEDA .= AND cochera LIKE
'%$f_cochera%' ; }

 if ($f_ubicacion  0) { $sql_BUSQUEDA .= AND ubicacion LIKE
'%$f_ubicacion%' ; }

 if ($f_apto  0) { $sql_BUSQUEDA .= AND apto LIKE '%$f_apto%' ; }

 $sql_BUSQUEDA .=  ORDER BY principal.id DESC;

 $result = mysql_query($sql_BUSQUEDA,$conn);

}

else

{

 $sql_BUSQUEDA = SELECT * FROM principal FULL JOIN detalles WHERE
codigo = '$f_codigo';

 $result=mysql_query($sql_BUSQUEDA,$conn);

 $row=mysql_fetch_row($result);

}

?



Thanks a lot!



+  _
   // Emiliano Boragina _
   // Diseño  Comunicación //
+  _
   // emiliano.borag...@gmail.com  /
   // 15 40 58 60 02 ///
+  _






-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] finder

2009-07-16 Thread Emiliano Boragina
Hi again…

I searching in www and find this (to do the finder):

$sql = SELECT buildings.*, citiy.* FROM buildings, city WHERE
buildings.idcity = city.id ;

 

Dont understand “building.*”... what do it means?

Thanks.

 

+  _
   // Emiliano Boragina _
   // Diseño  Comunicación //
+  _
   // emiliano.borag...@gmail.com  /
   // 15 40 58 60 02 ///
+  _

  _  

De: Dan Shirah [mailto:mrsqua...@gmail.com] 
Enviado el: Miércoles, 15 de Julio de 2009 09:17 a.m.
Para: Emiliano Boragina
CC: php-db@lists.php.net
Asunto: Re: [PHP-DB] finder

 

But with that it doesnt difference between full and empty field…

If the user want search on two posibilities on ten...

Maybe I'm not understanding what you're asking...

 

Or maybe you don't understand the query...

 

 

Say your form has 10 checkboxes.

 

If the users picks 3 out of ten boxes and clicks submit, the example I gave
you will search your database looking for all records that match the 3 check
boxes.

 

if $houses equals $_POST['houses'] then $houses will be empty if the
checkbox was not clicked and will not be included in the query.



[PHP-DB] finder

2009-07-16 Thread Emiliano Boragina
Hello… hello… and hello everyone…

 

I am sorry again to disturb this. I’ve got this from a web:

 

$sql = SELECT buildings.*, city.* FROM buildings, city WHERE
buildings.idcity = city.id ;
if (isset($_POST['txtSearch'])) 
{
$sql .=  AND buildings.title LIKE '% . $_POST['txtSearch'] . %' ;
if (intval($_POST['selCity'])  0) 
{
$sql .=  AND buildings.idcity = ' . intval($_POST['selCity']) .
';
}
}
$sql .=  ORDER BY city.name ASC;
$result = mysql_query($sql);

I dont understand if the second IF plus with the first IF or what, it means
the search is on buildings and city?

If I want to search more than one option I must tu add an IF like the
example for each extra option I want?

 

Thanks a lot... And sorry all this...

+  _
   // Emiliano Boragina _
   // Diseño  Comunicación //
+  _
   // emiliano.borag...@gmail.com  /
   // 15 40 58 60 02 ///
+  _

 



[PHP-DB] finder (I AM REALLY SORRY)

2009-07-16 Thread Emiliano Boragina
Sorry a lot of times!!!

Please... tell me (and help me) to know if this is right:

 

?

include conn.php;

 

$sql = SELECT * FROM principal FULL JOIN detalles FULL JOIN aestrenar FULL
JOIN fotos ON principal.id=detalles.id=aestrenar.id=fotos.id ORDER BY id
ASC;

$result=mysql_query($sql,$conn);

$row=mysql_fetch_row($result);

 

$f_codigo = $_REQUEST['codigo'];

$f_inmueble = $_REQUEST['inmueble'];

$f_operacion = $_REQUEST['operacion'];

$f_desde = $_REQUEST['fpreciodesde'];

$f_hasta = $_REQUEST['fpreciohasta'];

$f_moneda = $_REQUEST['moneda'];

$f_region = $_REQUEST['region'];

$f_barrio = $_REQUEST['barrio'];

$f_ambientes = $_REQUEST['ambientes'];

$f_dependencia = $_REQUEST['dependencia'];

$f_cochera = $_REQUEST['cochera'];

$f_ubicacion = $_REQUEST['ubicacion'];

$f_apto = $_REQUEST['apto'];

 

if(($f_desde = 0) || ($f_desde == )) { $f_desde = 0; }

if(($f_hasta = 0) || ($f_hasta == )) { $f_hasta = 0; }

if(($f_ambientes = 0) || ($f_ambientes == )) { $f_ambientes = 0; }

$f_precio = $f_desde = $row['precio'] = $f_hasta;

   

if($f_codigo == )

{

 $sql_BUSQUEDA = SELECT * FROM principal FULL JOIN detalles WHERE
';

 if ($f_inmueble  0) { $sql_BUSQUEDA .=  inmueble LIKE
'%$f_inmueble%' ; }

 if ($f_operacion  0) { $sql_BUSQUEDA .= AND operacion LIKE
'%$f_operacion%' ; }

 if ($f_precio) { $sql_BUSQUEDA .= AND precio = '$f_precio' ; }

 if ($f_moneda == 1) { $sql_BUSQUEDA .= AND moneda = '$f_moneda' ;
}

 if ($f_moneda == 2) { $sql_BUSQUEDA .= AND moneda = '$f_moneda' ;
}

 if ($f_region  0) { $sql_BUSQUEDA .= AND region LIKE
'%$f_region%' ; }

 if ($f_barrio  0) { $sql_BUSQUEDA .= AND barrio LIKE
'%$f_barrio%' ; }

 if ($f_ambientes  0) { $sql_BUSQUEDA .= AND ambientes LIKE
'%$f_ambientes%' ; }

 if ($f_dependencia  0) { $sql_BUSQUEDA .= AND dependencia LIKE
'%$f_dependencia%' ; }

 if ($f_cochera  0) { $sql_BUSQUEDA .= AND cochera LIKE
'%$f_cochera%' ; }

 if ($f_ubicacion  0) { $sql_BUSQUEDA .= AND ubicacion LIKE
'%$f_ubicacion%' ; }

 if ($f_apto  0) { $sql_BUSQUEDA .= AND apto LIKE '%$f_apto%' ; }

 $sql_BUSQUEDA .=  ORDER BY principal.id DESC;

 $result = mysql_query($sql_BUSQUEDA,$conn);

}

else

{

 $sql_BUSQUEDA = SELECT * FROM principal FULL JOIN detalles WHERE
codigo = '$f_codigo';

 $result=mysql_query($sql_BUSQUEDA,$conn);

 $row=mysql_fetch_row($result);

}

?

 

Thanks a lot!

 

+  _
   // Emiliano Boragina _
   // Diseño  Comunicación //
+  _
   // emiliano.borag...@gmail.com  /
   // 15 40 58 60 02 ///
+  _

 



[PHP-DB] finder

2009-07-15 Thread Emiliano Boragina
Hello… I must to do a finder with 10 posibilities.

This 10 can be full or empty.

(sorry... I just ask this but I’m not understand yet)

 

I know how to do a finder about any field, but this is my first time with
one like this where the user can find a “house” in a “zone” or find anything
in that “zone”.

I must use IF the field empty SELCET... if the field is full SELECT... that
with all??

Please... help...

Thanks a lot

 

+  _
   // Emiliano Boragina _
   // Diseño  Comunicación //
+  _
   // emiliano.borag...@gmail.com  /
   // 15 40 58 60 02 ///
+  _

 



RE: [PHP-DB] finder

2009-07-15 Thread Emiliano Boragina
But with that it doesnt difference between full and empty field…

If the user want search on two posibilities on ten...

+  _
   // Emiliano Boragina _
   // Diseño  Comunicación //
+  _
   // emiliano.borag...@gmail.com  /
   // 15 40 58 60 02 ///
+  _

  _  

De: Dan Shirah [mailto:mrsqua...@gmail.com] 
Enviado el: Miércoles, 15 de Julio de 2009 08:54 a.m.
Para: Emiliano Boragina
CC: php-db@lists.php.net
Asunto: Re: [PHP-DB] finder

 

Hello… I must to do a finder with 10 posibilities.

This 10 can be full or empty.

(sorry... I just ask this but I’m not understand yet)



I know how to do a finder about any field, but this is my first time with
one like this where the user can find a “house” in a “zone” or find anything
in that “zone”.

I must use IF the field empty SELCET... if the field is full SELECT... that
with all??

Please... help...

Thanks a lot

 

$house = $_POST['house'];

$zone = $_POST['zone'];

$abc = $_POST['abc'];

 

$query = SELECT * FROM real_estate WHERE 1 = 1;

if ($house != ) {

   $query.=AND house = '$house';

}

if ($zone != ) {

   $query.=AND zone = '$zone';

}

if ($abc != ) {

   $query.=AND abc = '$abc';

}

 



RE: [PHP-DB] resize 10 upload image

2009-07-12 Thread Emiliano Boragina
No, I don't =S

+  _
   // Emiliano Boragina _
   // Diseño  Comunicación //
+  _
   // emiliano.borag...@gmail.com  /
   // 15 40 58 60 02 ///
+  _

-Mensaje original-
De: Phpster [mailto:phps...@gmail.com] 
Enviado el: Sábado, 11 de Julio de 2009 11:13 a.m.
Para: Emiliano Boragina
CC: php-db@lists.php.net
Asunto: Re: [PHP-DB] resize 10 upload image





On Jul 10, 2009, at 10:18 PM, Emiliano Boragina
emiliano.borag...@gmail.com 
  wrote:

 Hi again…

 How do I do to resize more than one image when I upload using php  
 and not
 any library like the “gd”

 I have this:



 $folder=../products;

 copy($_FILES['5']['tmp_name'],$folder.'/'.$_FILES['5']['name']);

 $picture5=$_FILES['5']['name'];

 copy($_FILES['6']['tmp_name'],$folder.'/'.$_FILES['6']['name']);

 $picture5=$_FILES['6']['name'];

 .

 .

 .



 thanks



 +   
 
  _
   // Emiliano Boragina _
   // Diseño  Comunicación //
 +   
 
  _
   // emiliano.borag...@gmail.com  /
   // 15 40 58 60 02 ///
 +   
 
  _





How do you expect to resize an image without using gd, do you have  
imagemagik installed?

Bastien

Sent from my iPod=


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] mysql_insert_id() and JOIN

2009-07-12 Thread Emiliano Boragina
Sorry my question... but why I must use JOIN if I can use SELECT * FROM
table1 AND table2 AND table3 WHERE table1.id=table2.id=table3 not?
thanks

+  _
   // Emiliano Boragina _
   // Diseño  Comunicación //
+  _
   // emiliano.borag...@gmail.com  /
   // 15 40 58 60 02 ///
+  _


-Mensaje original-
De: Emiliano Boragina [mailto:emiliano.borag...@gmail.com] 
Enviado el: Sábado, 11 de Julio de 2009 11:08 a.m.
Para: 'php-db@lists.php.net'
Asunto: RE: [PHP-DB] mysql_insert_id() and JOIN


 Hi again…
 
 I dont understand how to use this two…
 
 I read php.net and other sites, but dont understand...

http://dev.mysql.com/doc/
Available in the major languages, pick your filter and start reading.
Having documentation in your own language may help a lot towards
understanding.

 I have this four tables: table1, 2, 3 and 4
 
 So the SELECT is like this?:
 
 ?
 
 $query_select = SELECT * FROM table1 FULL JOIN table2 FULL JOIN table3
FULL
 JOIN table4 ON table1.id=table2.id=table3.id=table4.id ORDER BY id ASC”;
 
 mysql_query($query_select);
 
 ?
 
 This is with FULL JOIN... How identificate the left table if I want to use
 LEFT JOIN?

The left table is the table to the left of the join. So:

SELECT id FROM table1 LEFT JOIN table2...

table1 is the left table and table2 is the right table (if you were to
use a RIGHT JOIN).

 With my 4 tables the sql is like this?:
 SELECT * FROM table1 LEFT JOIN table2 LEFT JOIN table3 LEFT JOIN table4
WHERE table1.id =  table2.id = table3.id = table4.id


 
 How is the UPDATE?
 
 And the INSERT I dont understand yet how is it?

UPDATEs and INSERTs follow the same procedure.

When you INSERT an entry into the main table, you then use the function
mysql_insert_id() which will give you the value of the last 'id' column
generated, which you can then use to insert data into the secondary
tables.

 How is the the slq query with mysql_insert_id()?

 
 I’m not to do a link between tables in PHPMyAdmin?
 
  
 
 Thank you very... VERY... much!
 

If you are using MySQL 4.1 or later you should use the mysqli extension
and not the older mysql one. UNLESS you are relying on the older style
passwords, which is a BAD idea.
 I dont know what version I use =S

 THANKS A LOT NEIL

--
Niel Archer



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] mysql_insert_id() and JOIN

2009-07-11 Thread Emiliano Boragina

 Hi again.
 
 I dont understand how to use this two.
 
 I read php.net and other sites, but dont understand...

http://dev.mysql.com/doc/
Available in the major languages, pick your filter and start reading.
Having documentation in your own language may help a lot towards
understanding.

 I have this four tables: table1, 2, 3 and 4
 
 So the SELECT is like this?:
 
 ?
 
 $query_select = SELECT * FROM table1 FULL JOIN table2 FULL JOIN table3
FULL
 JOIN table4 ON table1.id=table2.id=table3.id=table4.id ORDER BY id ASC;
 
 mysql_query($query_select);
 
 ?
 
 This is with FULL JOIN... How identificate the left table if I want to use
 LEFT JOIN?

The left table is the table to the left of the join. So:

SELECT id FROM table1 LEFT JOIN table2...

table1 is the left table and table2 is the right table (if you were to
use a RIGHT JOIN).

 With my 4 tables the sql is like this?:
 SELECT * FROM table1 LEFT JOIN table2 LEFT JOIN table3 LEFT JOIN table4
WHERE table1.id =  table2.id = table3.id = table4.id


 
 How is the UPDATE?
 
 And the INSERT I dont understand yet how is it?

UPDATEs and INSERTs follow the same procedure.

When you INSERT an entry into the main table, you then use the function
mysql_insert_id() which will give you the value of the last 'id' column
generated, which you can then use to insert data into the secondary
tables.

 How is the the slq query with mysql_insert_id()?

 
 I'm not to do a link between tables in PHPMyAdmin?
 
  
 
 Thank you very... VERY... much!
 

If you are using MySQL 4.1 or later you should use the mysqli extension
and not the older mysql one. UNLESS you are relying on the older style
passwords, which is a BAD idea.
 I dont know what version I use =S

 THANKS A LOT NEIL

--
Niel Archer



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] More than 50 entries!!!

2009-07-10 Thread Emiliano Boragina
Hi, I must to do a Admin to insert 50 entries on a table.

I solve it creating 4 tables in my PHPMyAdmin:

1) primary data

2) sec data

3) other data

4) pictures, almost 10 per product

 

How do I do to insert the data about the same product in 4 tables, and then
print them in the appropriate section on the web?

How do I do, the SELECT, INPUT and UPDATE to the 4 tables?

 

And how do I do a search with this 4 tables strucutre?

Thanks a lot!

 

+  _
   // Emiliano Boragina _
   // Diseño  Comunicación //
+  _
   // emiliano.borag...@gmail.com  /
   // 15 40 58 60 02 ///
+  _

 



[PHP-DB] resize 10 upload image

2009-07-10 Thread Emiliano Boragina
Hi again…

How do I do to resize more than one image when I upload using php and not
any library like the “gd”

I have this:

 

$folder=../products;

copy($_FILES['5']['tmp_name'],$folder.'/'.$_FILES['5']['name']);

$picture5=$_FILES['5']['name'];

copy($_FILES['6']['tmp_name'],$folder.'/'.$_FILES['6']['name']);

$picture5=$_FILES['6']['name'];

.

.

.

 

thanks

 

+  _
   // Emiliano Boragina _
   // Diseño  Comunicación //
+  _
   // emiliano.borag...@gmail.com  /
   // 15 40 58 60 02 ///
+  _

 



[PHP-DB] mysql_insert_id() and JOIN

2009-07-10 Thread Emiliano Boragina
Hi again…

I dont understand how to use this two…

I read php.net and other sites, but dont understand...

 

I have this four tables: table1, 2, 3 and 4

So the SELECT is like this?:

?

$query_select = SELECT * FROM table1 FULL JOIN table2 FULL JOIN table3 FULL
JOIN table4 ON table1.id=table2.id=table3.id=table4.id ORDER BY id ASC”;

mysql_query($query_select);

?

This is with FULL JOIN... How identificate the left table if I want to use
LEFT JOIN?

How is the UPDATE?

And the INSERT I dont understand yet how is it?

I’m not to do a link between tables in PHPMyAdmin?

 

Thank you very... VERY... much!

+  _
   // Emiliano Boragina _
   // Diseño  Comunicación //
+  _
   // emiliano.borag...@gmail.com  /
   // 15 40 58 60 02 ///
+  _

 



[PHP-DB] multiple finder

2009-06-29 Thread Emiliano Boragina
Hi, I must do e finder for properties... I know do a simple search but
not a search like this with more one possibility, with all or some
fields full... How do it?
Thanks a lot

--
+                                                    _
  Emiliano Boragina //
  Diseño y Comunicación /
+                                                    _
  emiliano.borag...@gmail.com 
  15 40 58 60 02 //
+                                                    _

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] mail

2009-05-05 Thread Emiliano Boragina
?php 
if(isset($_POST[empresa])  isset($_POST[nombre]) 
isset($_POST[telefono])  isset($_POST[mail]) 
isset($_POST[asunto])  isset($_POST[mensaje]) )
{   
$fecha = date(d.m.y H:i);
$mymail = emilino.borag...@gmail.com;
$subject = MEGGA INSUMOS SRL : Contacto webbr; 
$contenido .= Empresa: .$_POST[empresa].br;
$contenido .= Nombre y Apellido: .$_POST[nombre].br;
$contenido .= Telefono: .$_POST[telefono].br;
$contenido .= E-mail: .$_POST[mail].br;
$contenido .= Asunto: .$_POST[asunto].br;
$contenido .= Mensaje: .$_POST[mensaje].br;
$contenido .= El mensaje se escribio el .$fecha.br; 
$header =
From:.$_POST[mail].\nReply-To:.$_POST[mail].br;
$header .= X-Mailer:PHP/.phpversion().\n; 
$header .= Mime-Version: 1.0\n; 
$header = Content-Type: text/html; charset=utf-8\r\n;
//mail($mymail, $subject, utf8_encode($contenido) ,$header);

echo $contenido;
}else{
echo ERROR;
}

?

I test this code to send mail, but I am testing this printing $contenido.
If nothing is ISSET must be print ERROR, but not, if I send de form empty
this code print $contenido.
It is not working, why?
I am using a server (Appserv) in Windows

+      _
   // Emiliano Boragina _
   // Diseño  Comunicación //
+      _
   // emiliano.borag...@gmail.com  /
   // 15 40 58 60 02 ///
+      _



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] mail

2009-05-05 Thread Emiliano Boragina
Hi again,

Thanks Chris for your quickly answer. I dont test it yet.
I want to share with all you a very strange, for me, solution:

?php 
$empresa = $_POST[empresa];
$nombre = $_POST[nombre];
$telefono = $_POST[telefono];
$mail = $_POST[mail];
$asunto = $_POST[asunto];
$mensaje = $_POST[mensaje];

if($empresa ==  || $nombre ==  || $telefono ==  || $mail ==  ||
$asunto ==  || $mensaje == )
{
//echo ERROR;
header('location:contactenos.php?mensaje=error');
}
else
{
$fecha = date(d.m.y H:i);
$mymail = emilino.borag...@gmail.com;
$subject = my company : Contacto webbr; 
$contenido .= Empresa: .$_POST[empresa].br;
$contenido .= Nombre y Apellido: .$_POST[nombre].br;
$contenido .= Telefono: .$_POST[telefono].br;
$contenido .= E-mail: .$_POST[mail].br;
$contenido .= Asunto: .$_POST[asunto].br;
$contenido .= Mensaje: .$_POST[mensaje].br;
$contenido .= El mensaje se escribio el .$fecha.br; 
$header =
From:.$_POST[mail].\nReply-To:.$_POST[mail].br;
$header .= X-Mailer:PHP/.phpversion().\n; 
$header .= Mime-Version: 1.0\n; 
$header = Content-Type: text/html; charset=utf-8\r\n;
//mail($mymail, $subject, utf8_encode($contenido) ,$header);

//echo $contenido;
header('location:contactenos.php?mensaje=ok');
}
?

I want to know somthing: this || operator is OR, and de logic in my code
is: if one of variables is empty and the rest not send the mail, it isnt?
If I want all field full with data I must to use  AND operator, it isnt?
Well, if the answer is YES, I tell you: I test with  and send it anyway.

I dont understand... I am right or not with my afiration?
Thanks a lot!

+  _
   // Emiliano Boragina _
   // Diseño  Comunicación //
+  _
   // emiliano.borag...@gmail.com  /
   // 15 40 58 60 02 ///
+  _

-Mensaje original-
De: Chris [mailto:dmag...@gmail.com] 
Enviado el: Miércoles, 06 de Mayo de 2009 01:08 a.m.
Para: Emiliano Boragina
CC: php-db@lists.php.net
Asunto: Re: [PHP-DB] mail

Emiliano Boragina wrote:
 ?php 
 if(isset($_POST[empresa])  isset($_POST[nombre]) 
 isset($_POST[telefono])  isset($_POST[mail]) 
 isset($_POST[asunto])  isset($_POST[mensaje]) )
 { 

snip

 I test this code to send mail, but I am testing this printing $contenido.
 If nothing is ISSET must be print ERROR, but not, if I send de form
empty
 this code print $contenido.
 It is not working, why?

Maybe the post variables are there but they are empty.

$form_vars = array('empresa', 'nombre', 'telefono');

$error = false;
foreach ($form_vars as $var) {
   if (!isset($_POST[$var])) {
  echo Error - $var is missing\n;
  $error =  true;
  break;
   }

   if (empty($_POST[$var])) {
 echo Error: $var is empty (no value supplied)\n;
  $error =  true;
 break;
   }
}

if ($error) {
   die();
}

send_email_here();


-- 
Postgresql  php tutorials
http://www.designmagick.com/


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] SELECT LIKE with % and without %

2009-05-02 Thread Emiliano Boragina
Hello.

I am using this:
$sql = SELECT * FROM table WHERE ID LIKE '%$_GET[id]%' AND title LIKE
'%$_GET[word]%';

But I want exactlu ID, not one part of many possibles Ids in the DB.
How can I do that?

Thanks

+      _
   // Emiliano Boragina _
   // Diseño  Comunicación //
+      _
   // emiliano.borag...@gmail.com  /
   // 15 40 58 60 02 ///
+      _


RE: [PHP-DB] Run SQL query when click on OK button of warning message

2008-07-27 Thread Emiliano Boragina
Hi,

 

Why the “if(answer){” is not in the tag ?php?

 

+  _
   // Emiliano Boragina _

   // Diseño  Comunicación //
+  _

   // [EMAIL PROTECTED]  /
   // 15 40 58 60 02 ///
+  _


  _  

De: Nasreen Laghari [mailto:[EMAIL PROTECTED] 
Enviado el: domingo, 27 de julio de 2008 18:04
Para: php-db@lists.php.net
Asunto: [!! SPAM] [PHP-DB] Run SQL query when click on OK button of warning
message

 



 


 


Hi All,

 

I am printing a java script warning message. On pressing OK button, I want
to run an sql query. Below is the way I have tried but sql query is running
either press OK or Cancel button on warning message or even refresh the page
(F5). Also redirection, when press OK, also not working.

 

 

Am I using the right approach? Could any 1 please help me to sort this
problem.

 

 

Regards,

 

Nasreen  

 

 

 

trtd

input type=button onClick=var answer = confirm ('Are you sure you want
to delete this record!!')
 if (answer)
 {
  ?php

   $sqldel = DELETE FROM artist where aid = '$id';
   mysql_query($sqldel) or die(mysql_error());
   //header(Location: artist.php); 
   //window.location= http://www.yahoo.com/ http://www.yahoo.com/;
  ?  
 }
 else
 {
  window.location='index.php'
  } value=DELETE

/td/tr


 

 

 



[PHP-DB] php + mysql + copy file

2008-04-02 Thread Emiliano Boragina
Hello

I have the next code:

 

-- archive_a_subir.php --

form action=archivo_subir.php method=post
enctype=multipart/form-data

 input type=file name=file

 input type=submit value=ADJUNTAR ARCHIVO

/form

 

In archive_subir.php:

 

?

 $carpeta = subidos; // nombre de la carpeta ya creada. chmool 777
(todos los permisos)

 copy($_FILES['file']['tmp_name'] , $carpeta . '/' . $_FILE
['file']['name']);

?

 

You can see this in http://www.portbora.com.ar/foro/archivo_a_subir.php,
when I run these appears the next warning

 

Warning: copy(subidos/) [ http://www.portbora.com.ar/foro/function.copy
function.copy]: failed to open stream: Is a directory in
/home/pu000561/public_html/foro/archivo_subir.php on line 3

 

Why this? How can I run correctly?

Thanks.

 

+  _
   // Emiliano Boragina _

   // Diseño  Comunicación //
+  _

   // [EMAIL PROTECTED]  /
   // 15 40 58 60 02 ///
+  _