Jump to content

daleGT

Members
  • Posts

    16
  • Joined

  • Last visited

daleGT's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. They are currently still saving comma seperated into file14.! Input_upload1/2/3 are file14/15/16 I noticed that after i had posted the forum won't allow me to edit it.
  2. I'm using a joomla product call chronoforms attempting to save each file name seperatly into field14/15/16 etc now. The above is over my head. I had done the below code a few years back (basic but worked) i updated a program called "jumi" and it now no longer works <?php DEFINE ('DB_USER', 'username'); DEFINE ('DB_PSWD', 'password'); DEFINE ('DB_HOST', 'localhost.site.com'); DEFINE ('DB_NAME', 'username'); $dbcon = mysqli_connect(DB_HOST, DB_USER, DB_PSWD, DB_NAME); if (!$dbcon) { die('error connecting to database'); $sqlget = "SELECT * FROM `xtgt` ORDER BY `VIN` ASC"; $sqldata = mysqli_query($dbcon, $sqlget) or die('error getting'); } echo ''; $sqlget = "SELECT * FROM `xtgt` ORDER BY `VIN` ASC"; $sqldata = mysqli_query($dbcon, $sqlget) or die('error getting'); while($row = mysqli_fetch_array($sqldata, MYSQLI_ASSOC)) { Echo "<b>Build Number:</b><br> ".$row['VIN'] . " <br>"; Echo "<b>Engine Code:</b> ".$row['engine'] . " <br>"; Echo "<b>Trim Code:</b> ".$row['trim'] . " <br>"; Echo "<b>Trans Code:</b> ".$row['trans'] . " <br>"; Echo "<b>Paint Code:</b> ".$row['paint'] . " <br>"; Echo "<b>Tyre Code:</b> ".$row['tyre'] . " <br>"; Echo "<b>Dealer Code:</b> ".$row['dealer'] . " <br>"; Echo "<b>Factory Options:</b> ".$row['options'] . " <br>"; Echo "<b>Details/Comments:</b> ".$row['comments'] . " <br>"; $image1 = "[url=http://www.site.com/components/com_chronoforms5/chronoforms/uploads/xtgt/]http://www.site.com/components/com_chronoforms5/chronoforms/uploads/xtgt/[/url]".$row['file14'] ."<br>"; $size = getimagesize("$image1"); $height = $size[1]; $width = $size[0]; if ($height > 150) { $height = 150; $width = 190; } else if ($width > 150) { $height = 150; $width = 190; } Echo "<a href=\"[url=http://www.site.com/components/com_chronoforms5/chronoforms/uploads/xtgt/]http://www.site.com/components/com_chronoforms5/chronoforms/uploads/xtgt/[/url]".$row['file14'] ."\"> <img src=\"[url=http://www.site.com/components/com_chronoforms5/chronoforms/uploads/xtgt/]http://www.site.com/components/com_chronoforms5/chronoforms/uploads/xtgt/[/url]".$row['file14'] ."\" height=\"150\" width=\"190\" border=0 alt=\"" . $row['input_upload1'] . "\"> </a>" ; Echo "<a href=\"[url=http://www.site.com/components/com_chronoforms5/chronoforms/uploads/xtgt/]http://www.site.com/components/com_chronoforms5/chronoforms/uploads/xtgt/[/url]".$row['file15'] ."\"> <img src=\"[url=http://www.site.com/components/com_chronoforms5/chronoforms/uploads/xtgt/]http://www.site.com/components/com_chronoforms5/chronoforms/uploads/xtgt/[/url]".$row['file15'] ."\" height=\"150\" width=\"190\" border=0 alt=\"" . $row['input_upload2'] . "\"> </a>" ; Echo "<a href=\"[url=http://www.site.com/components/com_chronoforms5/chronoforms/uploads/xtgt/]http://www.site.com/components/com_chronoforms5/chronoforms/uploads/xtgt/[/url]".$row['file16'] ."\"> <img src=\"[url=http://www.site.com/components/com_chronoforms5/chronoforms/uploads/xtgt/]http://www.site.com/components/com_chronoforms5/chronoforms/uploads/xtgt/[/url]".$row['file16'] ."\" height=\"150\" width=\"190\" border=0 alt=\"" . $row['input_upload3'] . "\"> </a>" ; Echo "<b></b> ".$row[''] . " <br>"; Echo "<b></b> ".$row[''] . " <br>"; } ?>
  3. the names of the images wont conflict. it does go date/time/minute/second.
  4. Hey People! I'm saving & uploading images from a form into a data table. the image name is being changed into "datetime_imagename.jpg" when i select multiple images they are comma seperated. what is the best way to display these? I'm ok with a single image but multiple im struggling finding much info online. (doubt i know enough to find what im looking for)
  5. okie got it, this one works $sqlget = "SELECT * FROM `XAGT` WHERE `input_body` = 'sedan' AND `input_build` LIKE 'JG33N%' ORDER BY `input_build` ASC"; thanks Paul & Jess
  6. Paul thanks for the response $sqlget = "SELECT * FROM `XAGT` WHERE `input_body` = 'sedan' WHERE `input_body` LIKE 'JG33M%' ORDER BY `input_build` ASC"; gives an error getting (not sure if its because i gave you the wrong details in the first post) input_vin is supposed to be input_body, I did try to edit the post! I tried this based on your last post. $sqlget = "SELECT * FROM `XAGT` WHERE `input_body` = 'sedan' LIKE `input_build` = 'JG33M%' ORDER BY `input_build` ASC"; it does not return any records - but without error i checked the field & data and i do have results that should show up!
  7. sorry. input_vin is also input_build
  8. Hey People. Im obviously a newbie. Can someone help me with an sqlget This is what im currently using (it worked fine until people have added so many records it takes awhile to load) $sqlget = "SELECT * FROM `XAGT` WHERE `input_body` = 'sedan' ORDER BY `input_build` ASC"; Now what im trying to do is filter it by year "input_vin" records are in a format like "JG33Mabcdefg" the portion of the record that is equal to a year is "JG33M" = 1972 for example. So im trying to pull out just 1972 records. trying something like $sqlget = "SELECT * FROM `XAGT` WHERE `input_body` = 'sedan' WHERE `input_vin` = 'JG33M' ORDER BY `input_build` ASC"; any help would be great
  9. Champion! I was trying to use the WHERE i still struggle.
  10. Is it possible to use the Select from $sqlget = "SELECT * FROM For_Sale ORDER BY input_build ASC"; To sort by "input_build" ASC and also check "input_body" for one of the two options (coupe or sedan) & display only coupes as an example.
  11. Just used *below* & it seemed to work, thought it would be harder. Echo "<a href=\"http://www.blah.net/registry/partsforsale/".$row['input_image1'] ."\"> <img src=\"http://www.blah.net/registry/partsforsale/".$row['input_image1'] ."\" height=\"$height\" width=\"$width" border=0 alt=\"" . $row['input_image1'] . "\"> </a>" ;
  12. Excellent got it working, thanks for the help all who posted. I'm also looking to make the re-sized/adjusted displayed image link to the full sized image when clicked advice/tips would be great.
  13. here is the html.....the difference is clear. height/width not showing up //name from db <b>Part Details:</b> test <br> <b>Price:</b> 1234 <br> <b>Phone:</b> 123456789 <br> <b>Email:</b> dale@dcsi.net.au <br> <img src="http://www.blah.net/registry/partsforsale/20121106204104_xb3-5.jpg" height="" width="" /> <br><br> <b>Part Details:</b> ANOTHER TEST <br> <b>Price:</b> 10 <br> <b>Phone:</b> 123456789 <br> <b>Email:</b> dale@dcsi.net.au <br> <img src="http://www.blah.net/registry/partsforsale/20121108055459_67983x944y724.jpg" height="" width="" /> <br><br> //direct <b>Part Details:</b> test <br> <b>Price:</b> 1234 <br> <b>Phone:</b> 123456789 <br> <b>Email:</b> dale@dcsi.net.au <br> <img src="http://www.blah.net/registry/partsforsale/20121106204104_xb3-5.jpg" height="150" width="226.218097448" /> <br> <b>Part Details:</b> ANOTHER TEST <br> <b>Price:</b> 10 <br> <b>Phone:</b> 123456789 <br> <b>Email:</b> dale@dcsi.net.au <br> <img src="http://www.blah.net/registry/partsforsale/20121106204104_xb3-5.jpg" height="150" width="226.218097448" /> <br>
  14. Both ways show the image. From the database it doesn't re-size it. Direct does re-size. Thanks for the quick reply.
  15. Hi Guys & Girls, I've just started attempting to use PHP within Joomla to load data from an SQL database, I started off having some success but having some trouble with images. When the image is uploaded its saved on the server & the image name is saved into the database. I find when i pull the name from the database it wont re-size echo "<img src=\"http://www.blah.net/registry/partsforsale/".$row['input_image1'] ."\" height=\"$height\" width=\"$width\" />"; if i use the direct path to the image the re-size works echo "<img src=\"http://www.blah.net/registry/partsforsale/blah.jpg"\" height=\"$height\" width=\"$width\" />"; here is my code so far, no doubt most people on here could do it better, but it's doing what I want so far. any help & direction would be greatly appreciated. *btw i also need the re-sized image to link to the full size image!, but I'm working one problem at a time. <?php DEFINE ('DB_USER', 'blah'); DEFINE ('DB_PSWD', 'blah'); DEFINE ('DB_HOST', 'blah'); DEFINE ('DB_NAME', 'blah'); $dbcon = mysqli_connect(DB_HOST, DB_USER, DB_PSWD, DB_NAME); if (!$dbcon) { die('error connecting to database'); $sqlget = "SELECT * FROM Parts_For_Sale ORDER BY cf_id ASC"; $sqldata = mysqli_query($dbcon, $sqlget) or die('error getting'); } echo ''; $sqlget = "SELECT * FROM Parts_For_Sale ORDER BY cf_id ASC"; $sqldata = mysqli_query($dbcon, $sqlget) or die('error getting'); while($row = mysqli_fetch_array($sqldata, MYSQLI_ASSOC)) { Echo "<b>Part Details:</b> ".$row['input_part'] . " <br>"; Echo "<b>Price:</b> ".$row['input_price'] . " <br>"; Echo "<b>Phone:</b> ".$row['input_phone'] . " <br>"; Echo "<b>Email:</b> ".$row['input_email'] . " <br>"; $image = "http://www.blah.net/registry/partsforsale/".$row['input_image1'] ."<br>"; $size = getimagesize("$image"); $height = $size[1]; $width = $size[0]; if ($height > 150) { $height = 150; $percent = ($size[1] / $height); $width = ($size[0] / $percent); } else if ($width > 150) { $width = 150; $percent = ($size[0] / $width); $height = ($size[1] / $percent); } echo "<img src=\"http://www.blah.net/registry/partsforsale/".$row['input_image1'] ."\" height=\"$height\" width=\"$width\" />"; Echo " ".$row[''] . " <br><br>"; } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.