fugix
-
Posts
1,483 -
Joined
-
Last visited
Posts posted by fugix
-
-
since $_GET is an associative array, you can also use array_key_exists()
there are several ways to do what you want
-
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 }
-
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
-
ah I see, that would explain it. Glad you found your error.
I don't recommend storing HTML code inside of a variable in the future, causes confusion when incorporating the variable into your code.
-
can you show more code where you set your $imagetoshow variable
-
can you post your code please
-
you have forgotten to place you href and src attributes inside of quotations.
print "<tr><td><a href='$imagetoshow'><img src='$imagetoshow'></a></td><td>$title $subtitle</td><td>$location</td><td>$blurb</td></tr>";
-
have you read my edited post?
-
the error isn't caused by the code that I provided, most likely your are missing a closing curly bracket somewhere. If you cant figure it out post your code and I will look at it
-
<form method="post" action="#"> <!-- form contents --> </form>
-
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)) { ?>
-
Edit: misread the title.
Found this piece from php.net
Andrey P. 01-Mar-2011 03:23I 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.
-
is your movie_year field an INT?
-
change
print_r($_POST['senderID']);
to
print_r($_POST);
to make sure all necessary data is being past except for the senderID, post your results
-
why are you using javascript to validate your form instead of php? javascript can be disabled.
Is your $_POST['senderID'] empty?
Try using print_r($_POST); after your reply form has been submitted to see what is happening to that value
-
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>
-
what are the contents of your $row_Recordset1['filename']
-
I notice that you are using $_SERVER['PHP_SELF'] as your action in your forms. I do not recommend doing this as there are several risks to doing this, XSS injection etc...
Also, can you show the code specific to handling the replies please
-
can explain further what you mean by "response" please
-
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());
-
if($_SESSION['user']==1){ $option='edit'; } elseif($_SESSION['user']==2){ $option='approve/deny'; }
im assuming that neither of theses conditions are met, therefore you $options variable is never set
-
Welcome, feel free to ask us any questions along the way of your learning php
-
-
Can you post our code please
Setting A Variable Based Upon URL
in PHP Coding Help
Posted
a quick revision to the code above to 3 lines
$_SERVER['SERVER_NAME'] outputs www. included in the server name