pocobueno1388
Members-
Posts
3,369 -
Joined
-
Last visited
Never
Everything posted by pocobueno1388
-
[SOLVED] Need help putting together query.
pocobueno1388 replied to pocobueno1388's topic in MySQL Help
4.1.22 -
[SOLVED] Need help putting together query.
pocobueno1388 replied to pocobueno1388's topic in MySQL Help
Hmmm....same result =/ -
[SOLVED] Need help putting together query.
pocobueno1388 replied to pocobueno1388's topic in MySQL Help
I'm getting a "Invalid use of group function" error with that query =[ SELECT clubID, vote_for FROM (SELECT clubID, vote_for, COUNT(*) FROM club_votes GROUP BY clubID, vote_for ORDER BY COUNT(*) DESC) as x GROUP BY clubID Thank you both so much for helping me -
[SOLVED] Prefilling a form with PHP Data
pocobueno1388 replied to Clinton's topic in PHP Coding Help
Change the line to this: <input type="text" name="First" maxlength="60" value="<? echo $row['First']; ?>"> -
Maybe something like this: <?php $pages = array("forums", "chat", "news", "something"); if (in_array($c, $pages)){ echo "You are not logged in"; } ?>
-
Explain more? echo '"..."';
-
Have you been to this page? www.php.net/mcrypt
-
Take a look at mcrypt() www.php.net/mcrypt
-
Well, you can accept an array of ID's for the function parameter. <?php function id ($id_array){ //function stuff here } ?> Then inside your function you can loop through the array...
-
You just need to put the $display_block inside the loop: <?php //connect to database include'db.php'; //get all data from table $sql = "SELECT * from products"; $result = mysqli_query($mysqli, $sql) or die(mysqli_error($mysqli)); //if authorized, get the values while ($info = mysqli_fetch_array($result)) { $ItemNo = stripslashes($info['Item_No']); $Man = stripslashes($info['Manufacturer']); $Cat = stripslashes($info['Category']); $Des = stripslashes($info['Description']); $Model = stripslashes($info['Model']); $Qty = stripslashes($info['Qty']); $Kw = stripslashes($info['Kw']); $Hours = stripslashes($info['Hours']); $Price = stripslashes($info['Price']); //create display string $display_block = " <table border='1' cellspacing='0' cellpadding='0'> <tr> <td>".$ItemNo."</td> <td>".$Man."</td> <td>".$Cat."</td> <td>".$Des."</td> <td>".$Model."</td> <td>".$Qty."</td> <td>".$Kw."</td> <td>".$Hours."</td> <td>".$Price."</td> </tr> </table>"; //displays string with data echo "<p align=\"center\">"; echo "$display_block"; echo "</p>"; } ?>
-
[SOLVED] A little hep with getimagesize() ?
pocobueno1388 replied to djfox's topic in PHP Coding Help
You surrounded your variable in single quotes. Change it to this: <?php $filename = $rows[3]; echo filesize($filename) . ' bytes'; ?> I'm not sure if filesize() will give you the size of an image...at least from what I'm reading from my google search. Maybe $HTTP_POST_FILES['file name']['size'] -
[SOLVED] Getting image dimensions and size with php?
pocobueno1388 replied to djfox's topic in PHP Coding Help
http://www.php.net/getimagesize -
[SOLVED] mysql_real_escape_string question
pocobueno1388 replied to Asperon's topic in PHP Coding Help
mysql_real_escape_string() is used to prevent mySQL injection. You should use it on ALL variables before inserting them into the database. Addslashes() basically does the same thing. EXAMPLE USE: $var = mysql_real_escape_string($_POST['var']); You should google it and read more on the topic, their are plenty of articles out there about security. -
I agree with moberemk, the "Published Bar..." doesn't look very good. It either needs to be removed completely, or you need to make it more simple, like remove the table and just make the text a light gray color.
-
[SOLVED] Need help putting together query.
pocobueno1388 replied to pocobueno1388's topic in MySQL Help
Hmmm, I still can't figure this out =/ Illusion - I think I would rather find an alternative to your method... -
[SOLVED] Error MYSQL insert into table
pocobueno1388 replied to $username's topic in PHP Coding Help
Use mysql_real_escape_string() on all your variables. -
Well, they really didn't say any of that...so I had to start somewhere. Webguync, you need to be a lot more specific if cooldude is right about what you want.
-
Well, assuming you have the filename stored in the database...do this: <?php //get the image from the DB $query = mysql_query("SELECT image FROM images WHERE ...")or die(mysql_error()); $row = mysql_fetch_assoc($query); //display the image echo "<img src='path/to/image/".$row['image']."'>"; ?>
-
Well, give us the code you have already...then tell us exactly what you want to do.
-
Just use a hidden input. <input type='hidden' name='ID' value='<?php echo $row['id']; ?>'>
-
If there is absolutely no way to get around the header errors, you can get away with this. Place ob_start(); at the top of your script, then at the end place ob_end_flush(); That should take care of all those errors for you, and you should be able to place the head code anywhere.
-
Well, first off you select the ID from the database <?php $query = mysql_query("SELECT ID FROM table WHERE condition")or die(mysql_error()); $row = mysql_fetch_assoc($query); ?> To pass it on, you can use either a session, cookie, or hidden form input. If you have a submit button on that page, I would recommend the hidden form input...if not, I would use a session. Solution #1 - Hidden form Input <input type='hidden' name='id' value='<?php echo $row['id']; ?>'> Solution #2 - Session <?php $_SESSION['id'] = $row['id']; ?>
-
No problem =] Don't forget to press "solved".
-
Functions such as header() and setcookie() must be used before ANY output to the browser. My assumption would be that the file your including at the top has browser output in it. Does it work fine without including that file?
-
[SOLVED] A good way to "loop" this output?
pocobueno1388 replied to datafan's topic in PHP Coding Help
Change your while loop to this: <?php $i = 0; while ($row = mysql_fetch_assoc($result)) { $thumb = "files/userimages/" .$row['thpicname1']; if ($i == 3){ echo '<tr>'; $i=0;} echo "<td border='3' width='250'><a href='files/profileview.php?find=".$row['username']."' target='_self'> <img src='".$thumb."'></a><br>" .$row['realname']. "<br>" . $row['city'] . " , " . $row['state'] . " <br>Current Rating " . $row['currentrate'] . "</td>"; $i++; } ?>