Navigazione

    Privacy - Termini e condizioni
    © 2020 Search On Media Group S.r.l.
    • Registrati
    • Accedi
    • CATEGORIES
    • Discussioni
    • Non letti
    • Recenti
    • Hashtags
    • Popolare
    • Utenti
    • Stream
    • Interest
    • Categories
    1. Home
    2. jeeve
    3. Post
    J

    jeeve

    @jeeve

    • Profilo
    • Chi segue 0
    • Da chi è seguito 0
    • Discussioni 2
    • Post 4
    • Migliore 0
    • Gruppi 0
    Iscrizione Ultimo Accesso
    Età 52
    0
    Reputazione
    4
    Post
    0
    Visite al profilo
    0
    Da chi è seguito
    0
    Chi segue
    User Newbie

    Post creati da jeeve

    • RE: Variabili php in query mysql

      Qualcuno sa farmi un esempio di come devo fare per inserire in una query 4 variabili php in modo che poi da php mi appaia un menu a discesa per selezionare uno di questi quattro valori?

      postato in Coding
      J
      jeeve
    • Variabili php in query mysql

      Ecco il mio problema ho un file linguaggio che contiene le seguenti variabili

      <?php

      // 1.0.6

      // WHAT
      $lang['WHAT'] = 'WHAT';

      // WHERE
      $lang['WHERE'] = 'WHERE';

      // OPTIONS
      $lang['OPTIONS'] = 'OPTIONS';
      ?>

      Vorrei poter inserire in un campo varchar $lang['OPTIONS'] oppure $lang['WHERE'].

      In modo che poi da php mi appaia un menu a discesa con all'interno i valori what whare options qualcosa tipo..

      <select name="type2">' . generate_options_list(TYPES2_TABLE, $form['type2']) . '</select>'

      Ma non mi funzione perche mi stampa qusto valore $lang['OPTIONS'] e non options dove sbaglio???

      postato in Coding
      J
      jeeve
    • RE: Tabelle e variabili vuote

      file php

      [php]if (isset($_GET['id']) && eregi('^[0-9]+$', $_GET['id']))

      {

      $sql = 'SELECT title FROM ' . PROPERTIES_TABLE . ' WHERE approved = 1 AND id = ' . intval($_GET['id']) . ' LIMIT 1';
      $r_title = $db->query ( $sql );
      $f_title = $db->fetcharray ( $r_title );

      }

      $f = $db->fetcharray( $r );

      // Starting a new template
      $template = new Template;

      $tpl = implode ('', file( PATH . '/templates/' . $cookie_template . '/tpl/property_detailed.tpl' ));

      // Load listing short search results template
      $template->load ( $tpl );

      // Make all values in the array 'n/a' if empty
      $f = array_map ( 'if_empty', $f);
      $template->set ( 'dimensions', $f['dimensions'] );
      $template->set ( 'bathrooms', $f['bathrooms'] );
      $template->set ( 'half_bathrooms', $f['half_bathrooms'] );
      $template->set ( 'bedrooms', $f['bedrooms'] );
      $template->set ( 'soggiorno', $f['soggiorno'] );
      include ( PATH . '/templates/' . $cookie_template . '/footer.php' );[/php]

      file property_detailed.tpl

      [php] <tr>
      <td width="65%" valign="top">

       <table width="100%" border="0" cellspacing="0" cellpadding="0">
        
        <tr>
          <td>
      
           <table width="100%" border="0" cellspacing="0" cellpadding="2">
            <tr>
              <td width="32%"><b><font color="#DD6900">{@price}:</font></b></td>
      
              <td width="68%"><span class="price">{currency} {price} {@trattative_riservate}</span> </td>
            </tr>
            <tr>
              <td><b><font color="#DD6900">{@type2}:</font></b></td>
              <td>{type2}</td>
            </tr>
            <tr>
              <td><b><font color="#DD6900">{@type}:</font></b></td>
              <td>{type}</td>
            </tr>
            <tr>
              <td><b><font color="#DD6900">{@style}:</font></b></td>
              <td>{style}</td>
            </tr>
            <tr>
              <td><b><font color="#DD6900">{@year_built}:</font></b></td>
              <td>{year_built}</td>
            </tr>
            <tr>
              <td valign="top"><b><font color="#DD6900">{@location}:</font></b></td>
              <td>{address1} {address2} {city} {location} {zip}</td>
            </tr>
            <tr>
              <td valign="top"><b><font color="#DD6900">{@directions}:</font></b></td>
              <td>{directions}</td>
            </tr>
          </table>
      
         </td>
        </tr>
      
        <tr>
          <td><br><br>
      
           <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td>
               <table width="100%" border="0" cellspacing="0" cellpadding="2">
                <tr>
                  <td width="25%"><b><font color="#DD6900">{@bedrooms}:</font></b></td>
                  <td width="25%">{bedrooms} </td>
      

      <td width="25%"><b><font color="#DD6900">{@soggiorno}:</font></b></td>
      <td width="25%"><? if (!empty($f['soggiorno'])) { ?> {soggiorno} <br> <? } ?></td>

                  <td width="40%"><b><font color="#DD6900">{@half_bathrooms}:</font></b></td>
                  <td width="25%">{half_bathrooms}</td>
                </tr>
                <tr>
                  <td><b><font color="#DD6900">{@bathrooms}:</font></b></td>
                  <td>{bathrooms}</td>
                  <td><b><font color="#DD6900">{@lot_size}:</font></font></b></td>
                  <td>{lot_size} </td>
                </tr>
                <tr>
                  <td><b><font color="#DD6900">{@basement}:</font></b></td>
                  <td>{basement}</td>
                  <td><b><font color="#DD6900">{@dimensions}:</font></b></td>
                  <td>{dimensions}</td>
                </tr>
                
              </table>
      
             </td>
            </tr>
          </table>
      
         </td>
        </tr>
        <tr>
          <td><br><br>
      
           <table width="100%" border="0" cellspacing="0" cellpadding="2">
            
          </table><br><br>
      
         </td>
        </tr>
        
        <tr>
          <td>
      
           <table cellspacing="0" cellpadding="0" border="0" width="100%">
            <tr>
              <td width="100%" style="border-top: 1px dotted #BABABA;"><br>
              </td>
      
            </tr>
          </table>
      
         </td>
        </tr>
        <tr>
          <td>{description}<br><br> </td>
        </tr>
        <tr>
         <td>
          
         </td>
        </tr>
       </table>[/php]
      postato in Coding
      J
      jeeve
    • Tabelle e variabili vuote

      Ciao a tutti ecco il mio problema.

      Ho un file php nel quale prendo i dati da mysql, setto la lingua con un cookie setto le variabili e attraverso un file .tpl visualizzo i risultati che sono cosi:

      arance: 2 mandarini: 4 ananas: 5
      pere: 3 mele: 6 banane: 7
      noci: 4 mandorle: 9 prugne: 6

      Tanto arance che 2 sono variabili (cosi come tutte le altre)_nel senso che arance viene settata in base alla lingua di viusalizzazione.

      Nel caso un valore sia zero ad esempio mandarini la tabella mi appare cosi:

      arance: 2 mandarini: ananas: 5
      pere: 3 mele: 6 banane: 7
      noci: 4 mandorle: 9 prugne: 6

      Inserendo un ciclo if controllando il valore di mandarini e non passando la variabile mandarini mi appare cosi:

      arance: 2 ananas: 5
      pere: 3 mele: 6 banane: 7
      noci: 4 mandorle: 9 prugne: 6

      Mentre io vorrei che mi apparisse cosi:

      arance: 2 ananas: 5 pere: 3
      mele: 6 banane: 7 noci: 4
      mandorle: 9 prugne: 6

      Avete qualche dritta da darmi??

      postato in Coding
      J
      jeeve