techiefreak05
-
Posts
494 -
Joined
-
Last visited
Never
Posts posted by techiefreak05
-
-
mjdamato ::your code DID work perfect, but ONLY if a person offerered ONLY 1 item.
-
Here is my current code:
<?php $query = "SELECT trade_offers.*, members2.username FROM trade_offers LEFT JOIN members2 ON trade_offers.user_id = members2.id WHERE trade_id = $_GET[tradeid]"; $result = mysql_query($query) or DIE (mysql_error()); while ($record = mysql_fetch_array($result)) { $username = $record['username']; echo "<h4>Offer made By: " . $record['username'] . "</h4>\n"; echo "<img src=\"".$base_url."/images/user_images/opg_1/items/item_" . $record['item_id'] . ".gif\">\n"; } ?>
which shows "Offer made By:XXX" for every item offered, when it should only show "Offered made By:XXX" for the group of the items that the said person offered.
EXAMPLE OUTPUT:
when running the code from above, i actually get this exactly, except <item> is the image of the item.
*****************************
Offer made By: brenden
<item>
Offer made By: _test_
<item>
Offer made By: _test_
<item>
Offer made By: _test_
<item>
DESIRED OUTPUT:
Offer made By: brenden
<item>
Offer made By: _test_
<item> <item> <item>
See how all te items are grouped by the person who offered them?
-
@akitchin:
your query did not work at alll..
@mjdamato:
yours worked perfectly! ONLY ... if each person ofers only ONE item, but multiple are allowed...so if i offered you 2 items.. it shows one at the top of the page.. and the other one, under "Offer made By: techiefreak05"... but like I said its fine if there is only one item offered per person... so, how can we fix it?
-
Thanks, how would I put that query into the code?
-
im developing aan "item trade system" for a client of mine, and everything up to this point has worked, but the page where you view the offers of the trade, is very strage, but I know i thas something to do with my "while" loops. it only shows the last offer, when it should show them al and organize them by user. right now the database is setup , that when people make an offer, each seperate item is placed in the "trade_offers" table, with the "item_id" and "user_id" ... the following code should work, and it does... but it only shows the LATEST offer ...
<?php //GET USER ID#'s OF ALL OFFERERS $query1 = mysql_query("SELECT * FROM trade_offers WHERE trade_id = $_GET[tradeid]") or die(mysql_error()); while ($array1 = mysql_fetch_array($query1)){ $u__id = $array1[user_id]; } //RETREIEVE USERNAMES FOR DISPLAY PURPOSES ONLY $query3 = mysql_query("SELECT * FROM members2 WHERE id = $u__id") or die(mysql_error()); while ($array3 = mysql_fetch_array($query3)){ $offerer_Name = $array3[username]; echo "<h4>Offer made By: $offerer_Name</h4>"; } ///GET THE ITEMS OF EACH PERSON WHO MADE AN OFFER $query2 = mysql_query("SELECT * FROM trade_offers WHERE trade_id = $_GET[tradeid] AND user_id = $u__id") or die(mysql_error()); while ($array2 = mysql_fetch_array($query2)){ $item__id = $array2[item_id]; ?> <img src=<?php echo $base_url; ?>/images/user_images/opg_1/items/item_<?php echo $item__id;?>.gif> <?php } ?>
Thanks a lot in advance!!
-
it says 2 offers were made, and I knew that. :-)
-
hhmm, nope, no change.
-
i dont think this error means he doesnt have php installed, if he didnt, he wouldnt get a 500 erro. it would just show the page, with the code, just like my host does not have ColdFusion installed, so if try to run a .cfm file, it just shows the whole source without executing any code.
-
I'm creating a trading system for my friends pet site, and its sll going well, until you view the offers on a trade, even when there are more offers made, it only shows the latest one...heres the code
<?php $query1 = mysql_query("SELECT * FROM trade_offers WHERE trade_id = $_GET[tradeid]") or die(mysql_error()); while ($array1 = mysql_fetch_array($query1)){ $u__id = $array1[user_id]; $query3 = mysql_query("SELECT * FROM members2 WHERE id = $u__id") or die(mysql_error()); while ($array3 = mysql_fetch_array($query3)){ $offerer_Name = $array3[username]; } } $query2 = mysql_query("SELECT * FROM trade_offers WHERE trade_id = $_GET[tradeid] AND user_id = $u__id") or die(mysql_error()); while ($array2 = mysql_fetch_array($query2)){ $item__id = $array2[item_id]; } ?> <h4>Offer made By: <?php echo $offerer_Name; ?></h4> <img src=<?php echo $base_url; ?>/images/user_images/opg_1/items/item_<?php echo $item__id;?>.gif>
-
I was wondering how to run a query for every check box checked, Ive looked around the net and nothing I've come accross is too usefull.
-
I fixed the file error.. i just added a rewrite rule that pretty much ignored multiple slashes, like this: http://www.zwmster.com/////
any other suggestions would be appreciated!
thx agentsteal, for that code, ill try it out later. im at school
-
@agentsteal:
you love exploiting bugs dont you? ;-) haha thanks alot... any help on fixing these vulnerabilities!?!?
-
Currently it has no official name, but zwmster Media has just opened "zIM" (working title). It's a whole new network, it does not use AIM,Yahoo, etc... There is currently no prorgam avaiable to download, but there is a web interface simiar to meebo.
register and check it out!!
Add me to your list: brenden
--- http://www.zwmster.com/im ---
-
I use this rewrite rule to automatically add the "www" in front of my domain...
RewriteCond %{HTTP_HOST} !^www\.site\.com$ [NC] RewriteRule .? http://www.site.com%{REQUEST_URI} [R=301,L]
.. I have loads and loads of RewriteRules .... I have the url http://www.site.com/users/1 to show a users profile... but if I go to..notice the NO "www".... http://site.com/users/1 it ends up showing "http://www.site.com/users/1?id=1" in the URL! because the "/users/#" RewriteRule shows "/userProfs/?id=#" so going to http://www.site.com/users/1 is the same as going to http://www.site.com/userProfs/?id=1 ... but it ADS the ?id=1 to the re-written URL if i dont have the "www" in front.... any ideas!?
BASICALLY:
... going here: http://site.com/users/1
rewrite's to http://www.site.com/users/1?id=1 when it SHOULD rewrite to http://www.site.com/users/1
-
Thanks for the great help! wildteen, It worked! Thanks!
-
Not a thing... with any of those commands...no errors, no nothing.. I'm getting no output what so ever from the commands I'm trying...
-
*tries* ... Nope, nothing, the cursor just goes to the next line down after I hit Enter...
-
I am running WAMP Server on my computer, and I need to run a script with the PHP Command Line Interface... I've been doing some research and so I tried entering the folowing command into the php command window: php -h, that is supposed to show a list of commands... nut it does nothing... nothing I try works... any ideas?
-
Yes thanks, the dead link was due to my lazyiness in creating a corporate site. And yes, everything needs work... and thats a very interesting bug u found there!
-
holy cow... still lots of work to do... wow. How would I go about fixing those cross site scripting vulnerabilities?
ive also fixed the registration form. it SHOULD work now.
also, ive fixed that language error too.
-
zwmster media, corp has just launched the beta version of its "ZWM Accounts" service, its a service that is similar to Google Accounts, we offer several services in development in which you can test. Most of the services are fairly limited but a good enough basis to launch the BETA accounts. There are only 50 accounts open, so hurry and sign up here:
-
Currently, I need to connect to 4 different databases on one page to extract information. But 1 of the 4 connections isnt working, is there a limit of 3 connections or something?
-
!!! I got it!!
You have to treat variables in preg_match() as if it was echoed... like this:
<?php if(preg_match('/' . $meta_tag . '/i',$string)){ ?>
it just came to me, i tried it. and it works!! :-)
-
is there something wrong with my code? can you put variables inside preg_match() ?
... problem with "while" loops...
in PHP Coding Help
Posted
i dont know what you did for that second one, but it works!! thanks a lot everybody!!
I dont know what I would do without this forum... it's priceless!