Jump to content

fugix

Members
  • Posts

    1,483
  • Joined

  • Last visited

Posts posted by fugix

  1. a quick revision to the code above to 3 lines

    if ($url == 'www.specialpizza.com') $site = 'Special Pizza';
    if ($url == 'www.mainstreetspecialpizza.com') $site = 'Main Street Pizza';
    if ($url == 'www.elmstreetspecialpizza.com') $site = 'Elm Street Pizza';

    $_SERVER['SERVER_NAME'] outputs www. included in the server name

  2. placing the code in a while loop should fix the problem of only displaying one row, however I have realized an error that i made in the previous code, I placed the closing </table> tag inside of the while loop which I should not have done....try this instead.

    $result = mysql_query("SELECT * FROM `members`  WHERE username='".$_SESSION['username']."' limit $eu, $limit");
    while($fetch_users_data = mysql_fetch_object($result))
    {
    
    if($bgcolor=='#f1f1f1'){$bgcolor='#ffffff';}
    else{$bgcolor='#f1f1f1';}
    
    echo "<tr >";
    echo "<td align=left bgcolor=$bgcolor id='title'> <font face='Verdana' size='2'>".$fetch_users_data->statementdate."</font></td>"; 
    echo "<td align=left bgcolor=$bgcolor id='title'> <font face='Verdana' size='2'>".$fetch_users_data->statementtrasct."</font></td>";
    echo "<td align=left bgcolor=$bgcolor id='title'> <font face='Verdana' size='2'>".$fetch_users_data->amounttransact."</font></td>"; 
    echo "<td align=left bgcolor=$bgcolor id='title'> <font face='Verdana' size='2'>".$fetch_users_data->intacctbal."</font></td>"; 
    echo "<td align=left bgcolor=$bgcolor id='title'> <font face='Verdana' size='2'>".$fetch_users_data->charges."</font></td>";
    echo "<td align=left bgcolor=$bgcolor id='title'> <font face='Verdana' size='2'>".$fetch_users_data->acctbal."</font></td>";
    echo "</tr>"; //removed the </table> tag below
    }

     

  3. since you wish to display more than one row, you will need to place you mysql_fetch_object() function inside of a while loop. Also, I recommend puting your query into a variable before using it inside of the function

    $result = mysql_query("SELECT * FROM `members`  WHERE username='".$_SESSION['username']."' limit $eu, $limit");
    while($fetch_users_data = mysql_fetch_object($result))
    {
    
    if($bgcolor=='#f1f1f1'){$bgcolor='#ffffff';}
    else{$bgcolor='#f1f1f1';}
    
    echo "<tr >";
    echo "<td align=left bgcolor=$bgcolor id='title'> <font face='Verdana' size='2'>".$fetch_users_data->statementdate."</font></td>"; 
    echo "<td align=left bgcolor=$bgcolor id='title'> <font face='Verdana' size='2'>".$fetch_users_data->statementtrasct."</font></td>";
    echo "<td align=left bgcolor=$bgcolor id='title'> <font face='Verdana' size='2'>".$fetch_users_data->amounttransact."</font></td>"; 
    echo "<td align=left bgcolor=$bgcolor id='title'> <font face='Verdana' size='2'>".$fetch_users_data->intacctbal."</font></td>"; 
    echo "<td align=left bgcolor=$bgcolor id='title'> <font face='Verdana' size='2'>".$fetch_users_data->charges."</font></td>";
    echo "<td align=left bgcolor=$bgcolor id='title'> <font face='Verdana' size='2'>".$fetch_users_data->acctbal."</font></td>";
    echo "</tr>";
    echo "</table>";
    }

     

    Edit: since "members" is not a mysql reserved word, you do not need to wrap it in backticks, however this is still acceptable

  4. use the complex syntax on your session inside of you query, also, add some debugging just in case that fails

    <?php
    
    	$query = "SELECT * FROM selections WHERE username = '{$_SESSION['username']}'";
    	$result = mysql_query($query) or die(mysql_error());
    
    	while($row = mysql_fetch_assoc($result))
    	{
    ?>

  5. Edit: misread the title.  :shrug:

     

    Found this piece from php.net

     

    Andrey P. 01-Mar-2011 03:23

    I was trying to change permissions of a folder with chmod command with FTP connection. (I needed a writable folder to upload pictures with php)

     

    I got the following respond:

    "SITE CHMOD 777 uploads: command not understood"

     

    The reason: Server is running under Windows system that does not allow to set file permissions via FTP. Conversely, the UNIX-running servers allow that.

     

    Solutions:

     

    1. If your web hosting provider has a web-based control panel that lets you set file permissions, then you need to login there and make changes.

     

    2. It is possible to contact the hosting provider and ask them about this issue; maybe they can make the changes.

     

    3. It is possible to change the hosting provider that has servers run on UNIX, and keep the site there.

  6. No, I mean the one from which you've posted the above lines of code.

     

    I'm confused

    No, I mean the one from which you've posted the above lines of code.

    I don't understand

    i believe Pikachu means the actual file that contains

    <td><img src="images/blog/<?php echo $row_Recordset1['filename'];?>"/> </td>
    

     

  7. when you specify your $query value twice, you are actually overriding the first value of $query. I recommend doing something like this.

    $section1 = $_POST['section1'];
    $section2 = $_POST['section2'];
    $query="INSERT INTO selections (section1, section2) VALUES ('$section1', '$section2')";
    mysql_query($query) or die ("Error updating database: " . mysql_error());

×
×
  • 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.