[PHP] inserting ´ in a db

2007-10-03 Thread Yamil Ortega
Hi list, good day.

 

I have a simple script that inserts text on a mysql table, that has a field
named description and the type is text.

Everting works fine, except when I try to insert a text that includes a
simple quote. 

For example 

 

Yamil´s car

 

I send the character string to a variable and then insert into a query. But
the mysql says that something is wrong with the query because the quote
after the l looks like the end of the string, and “s car” doesn`t look like
a valid part of the query.

 

Can anyone help me out, how to handle this error?

 

Thanks

Yamil



RE: [PHP] Create a matrix gallery

2007-09-03 Thread Yamil Ortega


 -Mensaje original-
 De: Stut [mailto:[EMAIL PROTECTED]
 Enviado el: Lunes, 03 de Septiembre de 2007 06:31 p.m.
 Para: Humani Power
 CC: php-general@lists.php.net
 Asunto: Re: [PHP] Create a matrix gallery
 
 Humani Power wrote:
  hi list. I wonder if anyone can help me with this.
  i have a database with the file name of several images stored in a
  filesystem, and I want to create a table containing the image results of
 a
  query.
 
  this is my code
 
 snip
   while ($rows=mysql_fetch_assoc($getpic))
   {
extract ($rows);
echo tr;
   echo tda href=editing_image.php?pic=.$rows['image_id'].img
  src=.$ImageThumb.$rows['image_id']..jpg/td;
 }
 snip
  With this code, I am able to see the thumb images with their respective
 link
  ok, but if I have a query with 40 results, I will have a big row of
 images.
  
 
  |pic1 | pic2 | pic3 | pic4 | pic5 | pic6 | pic7 | pic8 | pic9 | pic10 |
  __
 
 
  What I want to to do is insert a new td after showing 5 thumb images,
 and
  continue with the next picture on the next row.
  something like this
  __
  |pic1 | pic2 | pic3 | pic4 | pic5 |
  __
  |pic6 | pic7 | pic8 | pic9 | pic10 |
  __
  |pic11 | pic12 | pic13 |
  __
 
 This is really quite simple...
 
 $col = 1;
 while ($rows=mysql_fetch_assoc($getpic))
 {
  extract ($rows);
  if ($col == 1) echo tr;
  echo tda href=editing_image.php?pic=.$rows['image_id'].img
 src=.$ImageThumb.$rows['image_id']..jpg/td;
  if ($col++ == 5)
  {
  echo /tr;
  $col = 1;
  }
 }
 
 Not sure why you are using extract when you then go on to use $rows as
 an array. Also, you're lacking quotes around the href in the link you
 output, and also the src in the image. It's also missing a closing /a
 tag. And you should be using urlencode when putting values into a URL.
 And while I'm at it, $row is more semantically correct than $rows.
 
 Try this...
 
 $col = 1;
 while ($row = mysql_fetch_assoc($getpic))
 {
  if ($col == 1) echo 'tr';
  $image_id = urlencode($row['image_id']);
  echo 'tda
 href=editing_image.php?pic='.urlencode($image_id).'img
 src='.$ImageThumb.urlencode($image_id).'.jpg //a/td';
  if ($col++ == 5)
  {
  echo '/tr';
  $col = 1;
  }
 }
 
 -Stut
 
 --
 http://stut.net/

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



RE: [PHP] Re: [BULK] [PHP] Redirecting to a parent page

2007-06-13 Thread Yamil Ortega
Ok, but what happens if I change server and there is no more apache2
directory?

Do I have to change all the headers in my 37 web pages?

Thanks in advance
Yamil

-Mensaje original-
De: clive [mailto:[EMAIL PROTECTED] 
Enviado el: Miércoles, 13 de Junio de 2007 05:37 a.m.
Para: PHP General List
Asunto: [PHP] Re: [BULK] [PHP] Redirecting to a parent page

Yamil Ortega wrote:

 Lets say that I have the next structure on my web directory
 /file1.php
 
 /procces/file2.php
 
 /file3.php

  http://localhost/apache2/file1.php

try this:

header( refresh:'3'; url=./apache2/file3.php);

Regards,

Clive.

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

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



[PHP] uploading big images.

2007-06-04 Thread Yamil Ortega
 

Hi, me again. I need to tell you that im completely new in LAMP, so please
don´t get tired with my silly questions :-).

 

I was able to upload and create thumb images with the same size. But now, I
am realizing that I can´t upload images bigger than 1 MB, I don´t know why.

I load the image through the upload image.php, then I check it with the
check_image.php file, and then, I show the result in the browser with the

 Show image file, but as I told you, only works with files less than 1 mb.
With bigger images, I only get a blank page without any errors.

 

I think it is a PHP.ini file configuration or something. Can you help me?

 

Thanks in advance.