mpc123 15 Junior Poster in Training

I have this code part of a bigger table with different field names being echoed.

echo "<tr><td>";
	echo $row['car'];
	echo "</td><td>";
	echo $row['caravan'];
	echo "</td><td>";

I need 2 pieces of help please.
I want to add an image of that car, the image is in a folder on the server and the image is named the same as the details in the details in the field that are being echoed. eg in the car field and being echoed is BMW X5 and the image will be images/BMW X5.jpg

I need to add the image in the same row with a break <br /> to ensure there is a space inbetween the field details and the image


Hope somebody can help

Thanks in advance

mpc123 15 Junior Poster in Training

Hi i have data in a mysql table which is about 70000 rows. In one column there is information that I would like to split into 2 rows. The information I want to send over to the other named row is nicely sat in brackets eg (18) . It is imperative whilst i move these over to the new named row that they stay aligned with the same row, as the information will be all wrong if not.

EG - i need to move the (18) and (24) over to colomn 4 and delete from column 2 the (18) and (24)

Colomn 1 Colomn 2 Colomn 3 Colomn 4

row 1 xxxxxx xxx (18) xxxxxxx

row 2 xxxxxx xxx (18) xxxxxxx

row 3 xxxxxx xxx (24) xxxxxxx

row 4 xxxxxx xxx (18) xxxxxxx


What code would I need to run to enable me to do this.

Thanks for your help

mpc123 15 Junior Poster in Training

perfect thank you

mpc123 15 Junior Poster in Training

it need to be if it is NULL or 0 (as in ZERO) please , please can you give full code.

Thanks again

mpc123 15 Junior Poster in Training

would that not make every price free?

mpc123 15 Junior Poster in Training

I have this code presently for null to say free but i need also if the info in the ProductPrice field is 0

echo is_null($row['ProductPrice']) ? "FREE" : $row['ProductPrice'];
	echo "</td><td>";

Please help

mpc123 15 Junior Poster in Training

on the page i would like a drop down menu populated by the database to select a filed of which selected fields asociated with it in the dabase will show in a virtical table below. Then exactly the same next to it for them to do the same and compare results.

Hope this is better explaination

Hope somebody can help

mpc123 15 Junior Poster in Training

I have products in a data base with several features to compare, i could do with 2x drop down menus where they are populated by the database and then once selected a table is echoed with all the feature fields. The 2nd one will be so you can compare a 2nd product with the same features fields


Please can you help

mpc123 15 Junior Poster in Training

Really hope you can help with this one

I have a problem whereby i cant get all my data (over 1million and different csv files) to map and import properly, so i thought it would be better to create new tables with all the information seperate (which i can do within a few seconds each time). The only problem is my code currently just checks one table, how would i get it to do the same as now but check for example 5 different tables for the information

My current code is as below

all connection details:

<?php
$result = mysql_query("SELECT * FROM TABLE Where Name LIKE 'Smith%' ORDER BY Field10 asc") 
or die(mysql_error());  

echo "<table class = results >";
echo "<tr> <th>Field1</th> <th>Field2</th> <th>Field3</th> <th>Field4</th> <th>Field5</th> <th>Field6</th> <th>Field7</th> <th>Field8</th> <th>Field9</th> <th>Field10</th> <th>Field11</th></tr>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $result )) {
    // Print out the contents of each row into a table
    echo "<tr><td>"; 
    echo $row['Field1'];
    echo "<img src='".$row['ImageUrl']."'width='60' height='80'/>";
    echo "</td><td>";
    echo $row['Field2'];
    echo "</td><td>"; 
    echo $row['Field3'];
    echo "</td><td>";
    echo $row['Field4'];
    echo "</td><td>";
    echo $row['Field5'];
    echo "</td><td>";
    echo $row['Field6'];
    echo "</td><td>";
    echo is_null($row['Field7']) ? "N/A" : $row['Field7'];
    echo "</td><td>";
    echo $row['Field8'];
    echo "</td><td>";
    echo $row['Field9'];
    echo "</td><td>";
    echo $row['Field10'];
    echo "</td><td>";
    echo sprintf( '<a href="%s"><img src="%s"/></a>', $row['Field11'], '/buyNow.gif' );
    echo "</td></tr>";
} 

echo "</table>";
?>

Thanks if someone can help

mpc123 15 Junior Poster in Training

I have results of people that i need to compare and echo out. Eg 2x dropdown menus with all the peoples names in and each field then echoed in a table once the 2x dropdowns have been selected. the 2x dropdowns will be the same and have the same names in.


Martin Peter
(martin image) (peter image)
field 1 - 56 field 1 - 56
field 2 - 22 field 2 - 22
field 3 - 72 field 3 - 56
field 4 - 75 field 4 - 56


Hope somebody can help as need it for a project.

mpc123 15 Junior Poster in Training

Really sorry it does work, my fault. Thanks for your very quick help

mpc123 15 Junior Poster in Training

thanks for your help

it does change to null but all are changed to null

mpc123 15 Junior Poster in Training

Please help with this if you can

My example code below is part of a table that echos several fields, for this field I need to echo the text of the field which the below example code now does, but i need to make it state N/A if the field is Null also which i guess would be with a if/else command but got no idea how to fit it in with the current code

echo $row['model'];
	echo "</td><td>";

Thanks for your help and time

mpc123 15 Junior Poster in Training

thanks alot that seems to have sorted it. Thanks again

mpc123 15 Junior Poster in Training

no it just messes the whole table up, no master page.


Thanks for trying to help

mpc123 15 Junior Poster in Training

Please can somebody help with this. I want a Buy Now image to go to the producturl in the database, at the moment I am just echoing , so it only shows the text of the url in the cell.

my code currently is

echo $row['ProductUrl'];
	echo "</td></tr>";

Hope somebody can help as it is driving me mad..... newbies hey!!!!!

mpc123 15 Junior Poster in Training

thanks for the help, but i get an error on the page row number that is outside the </body> of the page????

What is the problem please?

mpc123 15 Junior Poster in Training

Sorry very very new to php , obviously my code below is wrong. What should the code be?

$result = mysql_query("SELECT * FROM TEST Where Name LIKE 'Smith%'") 
or die(mysql_error()); 

// Print out result
while($row = mysql_fetch_array($result)){
	echo "There are ". $row['COUNT(Surname)'] .";
}

Thanks If anyone can help

mpc123 15 Junior Poster in Training

sorry i seem to have mislead you, all the rows will be full with fields from the database information but the bottom one is a product url i need to put a buy now image that i have in its place but with that a link from the database field .

So when the customer clicks on that image it takes them to the

Hope i have explained myself better

mpc123 15 Junior Poster in Training
while($row = mysql_fetch_array( $result )) {
	echo "<tr><td>"; 
	echo $row[''];
	echo "<img src='".$row['ImageUrl']."'width='60' height='80'/>";
	echo "</td><td>";
	echo $row[''];
	echo "</td><td>"; 
	echo $row[''];
	echo "</td><td>";
	echo $row[''];
	echo "</td><td>";
	echo $row[''];
	echo "</td><td>";
	echo $row[''];
	echo "</td><td>";
	echo $row[''];
	echo "</td><td>";
	echo $row[''];
	echo "</td><td>";
	echo $row[''];
	echo "</td><td>";
	echo $row[''];
	echo "</td><td>";
	echo $row['ProductUrl'];
	echo "</td></tr>";

Hope that is better, yet again thanks for trying to help

mpc123 15 Junior Poster in Training

thanks for your reply but the code does not seem to work

mpc123 15 Junior Poster in Training

Sorry very very new to php , at the end of my table is the following

echo $row['ProductUrl'];
	echo "</td></tr>";
}

i want to have an image show on the page and on click of that image it then go to the product url.

The [ProductUrl] from data base is a full http:// url

Please can you help