Visualizzazione dei risultati da 1 a 8 su 8
  1. #1

    Ciao piccolo problema db con url ed immagini

    Ciao sono nuovo ed ho bisogno di una mano.
    Ho una tabella in mysql con i seguenti campi id, modello immagine e link
    i primi due ovviamente primary e varchar (255) immagine ho fatto varchar(255)
    MIME: text/plain (imagelink) e link varchar(100)
    MIME: text/plain

    La pagina php legge bene la tabella però non riesco a vedere le immagini ed i link...
    Vi posto il codice:
    [PHP]

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title> Offerte Scarpe</title>
    <link href="tabella.css" rel="stylesheet" type="text/css">
    </head>
    <body>
    <font size ='4px'> <p align="center">OFFERTE </font></p>
    <table>

    <?php

    include ("config4.php");
    //include ("mostra.php");
    $result = mysql_query("SELECT * FROM test{$test}");
    if (!$result) {
    die("Query to show fields from table failed");
    }

    $fields_num = mysql_num_fields($result);

    echo "<h1>Last Minute {$test}</h1>";
    echo "<table border='1'><tr>";
    // printing table headers

    for($i=0; $i<$fields_num; $i++)
    {
    $field = mysql_fetch_field($result);
    echo "<td>{$field->name}</td>";
    }
    echo "</tr>\n";
    // printing table rows
    while($row = mysql_fetch_row($result))

    {
    echo "<tr>";

    // $row is array... foreach( .. ) puts every element
    // of $row to $cell variable
    foreach($row as $cell)
    echo "<td>$cell</td>";

    echo "</tr>\n";
    }
    mysql_free_result($result);
    ?>
    </body></html>


    Come posso fare???

    Ciao e grazie

  2. #2
    Utente di HTML.it L'avatar di homerbit
    Registrato dal
    Dec 2005
    residenza
    Roma
    Messaggi
    1,380
    cosa hai salvato nel campo immagine del db?
    If you think your users are idiots, only idiots will use it. DropBox

  3. #3
    Gli ho messo l'url della foto. http://191.68.0.100/images/last.png
    Nella stampa della tabella mi esce l'indirizzo...nemmeno cliccabile...

  4. #4
    Utente di HTML.it L'avatar di homerbit
    Registrato dal
    Dec 2005
    residenza
    Roma
    Messaggi
    1,380
    è naturale
    inserisci il percorso della immagine in un tag <img src =""> come si fa normalmente con html
    If you think your users are idiots, only idiots will use it. DropBox

  5. #5

    problema db con url ed immagini

    Si infatti dovresti inserire nel codice php

    tipo ->

    echo '[img]$row[[/img]' per l'immagine ed

    echo 'link per Visualizzare l'immagine'

    Spero di esserti stato di aiuto...
    Aiutati che dio ti Aiuta !

  6. #6
    Ciao ragazzi, ho inserito i tag che mi avete suggerito, ma se posso postare una foto vi faccio vedere come viene...
    Come potete notare l'immagine esce dalla tabella.
    Immagini allegate Immagini allegate

  7. #7
    Ho risolto al 90%.. Ho inserito il codice da voi proposto in queste righe // $row is array... foreach( .. ) puts every element // of $row to $cell variable foreach($row as $cell) echo "<td>$cell</td>";

    echo "</tr>\n

    Va tutto bene ora volevo non fa vedere alcune colonne
    http://www.angelogalantino.com

  8. #8

    [Risolto] Problema url ed immagini

    Ho risolto nel seguente modo:

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title> Offerte Scarpe</title>
    <link href="tabella.css" rel="stylesheet" type="text/css">
    </head>
    <body>
    <font size ='4px'> <p align="center">OFFERTE </font></p>
    <table>

    <?php

    include ("config4.php");
    //include ("mostra.php");
    $result = mysql_query("SELECT * FROM test{$test}");
    if (!$result) {
    die("Query to show fields from table failed");
    }

    $fields_num = mysql_num_fields($result);

    echo "<h1>Last Minute {$test}</h1>";
    echo "<table border='1'><tr>";
    // printing table headers

    for($i=0; $i<$fields_num; $i++)
    {
    $field = mysql_fetch_field($result);
    echo "<td>{$field->name}</td>";
    }
    echo "</tr>\n";
    // printing table rows
    while($row = mysql_fetch_row($result))

    {
    echo "<tr>";

    // $row is array... foreach( .. ) puts every element
    // of $row to $cell variable
    //foreach($row as $cell)
    echo "<td>$row[0]</td>";
    echo "<td>$row[1]</td>";
    echo "<td>$row[2]</td>";
    echo "<td>$row[3]</td>";
    echo "<td>$row[4]</td>";
    echo "<td>[img].$row[5].[/img]</td>";
    echo "<td>link per Visualizzare</td>";
    echo "</tr>\n" ;
    echo "</tr>\n";
    }
    mysql_free_result($result);
    ?>
    </body></html>

    Molto molto semplice...
    http://www.angelogalantino.com

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.