microbert 0 Newbie Poster

thankyou both for your help. it worked for me.

microbert 0 Newbie Poster

Hi,

I am using php and html and i am trying to make two buttons:
- Print button: that print a specific picture (not the whole page)
- Download button: which will display the save as window to save a picture.

Do you know if this is possible and how, should it be done?

thanks

microbert 0 Newbie Poster

I have tried the code that broj1 wrote and it worked as I wanted it to be.

but when i tried to modify it to work with my database it didn't work?

is there a way to put the data from the database into the array, or there is a better way to do it?

microbert 0 Newbie Poster

Thank you for your reply.

I have tried the method of pritaeas and while I have managed to make 2 coloums (even if I wanted to make 5) but all the data was put in the 1st coloum while the 2nd column was empty.

I have also tried the method of broj1 and it put the picture in 1st coloum and the text in 2nd column.

Now, in one cell i'd like to make the picture and the text. and it is placed in a table which will have 5 columns ( in each column there will be pic & text) then after 5 columns it will begin another row.

if you can help me solve the problem i will really appreciated, since I have been trying to solve this for a long time.

microbert 0 Newbie Poster

Hi,

I have a While Loop to display my MySQL info.

This makes a list of all my data, in one row.
But what I want is it to display it in a table with 5 columns so that the data is more readable.

this is my code:

while ($row = mysql_fetch_array($retd)) 
{ 
$code = $row["code"];
$name = $row["name"];
echo("<td width=150 align=center>");
echo ("<a href=../item?scode=$code><img src=pictures/$code.gif border=0 alt=Item $name</a>");
echo ("<br><a href=../item?scode=$code><span class=fs13>$name</span></a>");
echo("</td>");
}

Now I have tried to make it like this:

<tr>
     <td></td>
     <td></td>
     <td></td>
     <td></td>
     <td></td>
</tr>

But it didn't work, since it repeated the same item for 5 times.

Does anyone know what can I change to make it work?

If you need more explaination, ask.
THANKS FOR THE HELP!!

microbert 0 Newbie Poster

Hi this is my Show Create table output:

SQL result

Host: localhost
Database: bitsbytes
Generation Time: Nov 15, 2011 at 09:15 AM
Generated by: phpMyAdmin 3.3.9 / MySQL 5.5.8
SQL query: SHOW CREATE TABLE list; 
Rows: 1

Table	Create Table
list	CREATE TABLE `list` (
 `code` varchar(50) NOT NULL DEFAULT '',
 `catno` varchar(255) NOT NULL DEFAULT '',
 `name` varchar(255) NOT NULL DEFAULT '',
 `price` float(6,2) NOT NULL DEFAULT '0.00',
 `discount` float(4,2) NOT NULL DEFAULT '0.00',
 `info` text NOT NULL,
 `link` varchar(255) NOT NULL DEFAULT 'http://',
 `stock` int(1) NOT NULL DEFAULT '1',
 `latest` int(11) NOT NULL DEFAULT '0',
 `special` int(2) NOT NULL DEFAULT '0',
 `specialp` float(6,2) NOT NULL DEFAULT '0.00',
 `weekly` int(1) NOT NULL DEFAULT '0',
 `new` int(11) NOT NULL DEFAULT '0',
 `lowprice` int(11) NOT NULL DEFAULT '0',
 `related` text NOT NULL,
 `relatedcat` text NOT NULL,
 `kw` text NOT NULL,
 `rdiscount` float(4,2) NOT NULL DEFAULT '0.00',
 `backinstock` int(1) NOT NULL DEFAULT '0',
 PRIMARY KEY (`code`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1

Can you please explain to me what do you mean by "dump of your test data"

thanks

microbert 0 Newbie Poster

Hi, sorry for my late reply.

I have performed the repair but still I have the problem.

I am starting to think that there isn't a solution, but when I think about it why I am the oly one with the problem?

microbert 0 Newbie Poster

thanks for your reply.

Here is the code:

<?php
require_once "config.php";
$q = strtolower($_GET["q"]);
if (!$q) return;

$sql = "select DISTINCT kw from list where kw LIKE '%$q%'";
$rsd = mysql_query($sql);
while($rs = mysql_fetch_array($rsd)) {
	$cname = $rs['kw'];
	echo "$cname\n";
}
?>

But after more troubleshooting I still cannot find the problem since this only effect searches of "Blank, Blanking, Blan, lank" other words like "lan, ank, Bank" they work fine. Thats why I thing that the problem is not from the coding but from the mysql. I was thinking that Blank is an sql command and for some reason it is interfering with my search.

anyhow if you need more information ask, because now i really want to know whats happening.

microbert 0 Newbie Poster

Hi,

I have build my website with PHP and MySQL and when I was debugging I noticed a problem which I cannot find a way around it.

Basically I have a search box on my website, which will search from a column that I have on MySQL database.
Now I noticed that if in the search box I search "blanking", the search does not work. after some troubleshooting I find out that the problem is with the word "blank".

Does anyone has encountered this problem, or now a way to get around it?

thanks in advance for your help, it will be very appreciated.

regards,
Robert