Sunday, 21 January 2007
|
| First Character In A String Christopher Deeley 19:38:51 |
| | Can anyone tell me if there is a function to return the first letter in a string, such as:
$surname="SMITH"; $forename="ALAN";
Is there a function which I can use to make $forename "A", so I can display it as A SMITH?
Thank You In Advance
|
| | 7 answers | Add comment |
|
| Script to generate a site thumbnails Pablo L. de Miranda 17:29:00 |
| | Hi People,
I'm needing a script that generate a site thumbnail from a given URL. Anybody can help me?
Thanks,
-- Pablo Lacerda de Miranda Graduando Sistemas de Informa o Universidade Estadual de Montes Claros pablolmiranda@gmail.com
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 3 answer | Add comment |
|
| Access restrictions for Forum application Dirk H. Schulz 16:49:22 |
| | Hi folks,
I am looking for a possibility to have forum categories that can only be accessed by certain user groups.
Forum application seems not to be able to do that.
Fudforum cannot be administered because the /adm folder is not inside the /fudforum folder in the current tarball (by the way: is that on purpose?).
Any other idea? Or is it nowhere implemented?
Thanks for any help or hint.
Dirk
|
| | 1 answer | Add comment |
|
| Forced File Downloads Don 16:32:24 |
| | I've been having my forced downloads sometimes finish prematurely using readfile(). I'm downloading a Windows .exe file.
I've read several posts that have suggested the substitution of a fread/feof loop to write out the download in smaller chunks. I tried using a function (readfile_chunked) I found in the user comments on php.net.
But for some odd reason, every time the downloaded file is one byte larger than the original file, and it's not being recognized as a valid Windows file.
I'm using PHP 4.4.4 on a shared Linux server running Apache. IE and FireFox both exhibit the problem on the Windows end. I'm using WinXP SP2.
I've listed relevant snippets below. $file_name is the fully qualified path to the (.exe) file.
Any ideas? #=============================
# Download the File
#=============================
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private", false);
header("Content-Description: File Transfer");
header("Content-Type: application/octet-stream");
header("Accept-Ranges: bytes");
header("Content-Disposition: attachment; filename=" . $file_name . ";");
header("Content-Transfer-Encoding: binary");
header("Content-Length: " . @filesize($file_path));
header ("Connection: close");
@ignore_user_abort();
@set_time_limit(0);
// @readfile($file_path);
readfile_chunked($file_path, FALSE);
exit();
......
function readfile_chunked($filename, $retbytes = true) {
$chunksize = 8 * 1024; // how many bytes per chunk
$buffer = '';
$cnt = 0;
$handle = fopen($filename, 'rb');
if ($handle === false) {
return false;
}
while (!feof($handle)) {
$buffer = fread($handle, $chunksize);
echo $buffer;
ob_flush();
flush();
if ($retbytes) {
$cnt += strlen($buffer);
}
}
$status = fclose($handle);
if ($retbytes && $status) {
return $cnt; // return num. bytes delivered like readfile() does.
}
return $status;
}
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 2 answer | Add comment |
|
| Request for... Wikus Moller 16:09:29 |
| | Hi.
Since this is a mailing list for web developers, I thought I might as well post an o f f t o p i c request. Does anyone know of any website where I can get a exe or jar sitemap generating software? Particularly not GsiteCrawler as it uses too much system resources. A java applet would be nice. And, if possible, free of charge ^.^
And does anyone know how and if a j a v a applet can be extracted from a webpage?(also a class)
Thanks Wikus
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 10 answers | Add comment |
|
| I lied, another question / problem Beauford 15:34:56 |
| | I have file which I use for validating which includes the following function:
function invalidchar($strvalue) { if(!ereg("^[[:alpha:][:space:]\'-.]*$", $strvalue)) { return "*"; } }
Here is the problem. If I don't use the function, like below, there is no problem.
if (empty($person)) { $formerror['person'] = "*"; } elseif(!ereg("^[[:alpha:][:space:]\'-.]*$", $person)) { $formerror['person'] = "*"; }
If I use the one below it says $formerror['person'] is set, but if I echo it there is nothing in it. But here is the kicker, I have several other scripts that use the same function with no problems. In fact, I have another form which uses the code below with no problems. So I am at a loss as to what the problem is. I have deleted all other validating except for the one below to try and narrow this down, but still at a loss. One last thing, if I unset $formerror['person'] at the end of the code below, it works. So obviously it has a value - but what is it and how is it getting it?????? Am I just losing it????
if (empty($person)) { $formerror['person'] = "*"; } else { $formerror['person'] = invalidchar($person); }
Any help before I go insane.
This is the entire code:::
<? session_start();
if(isset($_SESSION['nodatabase'])) { unset($_SESSION['nodatabase']); } $databasename = "database"; include_once("constants.php"); // This has the functions in it
if($mysubmit && !$_SESSION['added']) {
$name = slashstrip( $_POST['person'] ); $place = slashstrip( $_POST['place'] ); $comment = slashstrip( $_POST['comment'] );
if (empty($person)) { $formerror['person'] = "*"; } else { $formerror['person'] = invalidchar($name); if($formerror['person']) { $formerror['person'] = "*"; } }
if (!$formerror) {
// Calls function to write entries to database - which works if I could get here
$inserterror = writerecord($today, $_SESSION['cfname'], $person, $place, $comment, $ipaddrs); if($inserterror) { $headerror = $inserterror; } else { $_SESSION['added'] = True; } } else { $headerror = formerrors; } }
?>
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 24 answer | Add comment |
|
| Re: [PHP-DEV] Plz help me. I can not login my account. Nuno Lopes 13:40:28 |
| | We don't use cvs over ssl, just plain pserver auth. If you forgot your password, you can modify it at http://master.php.net/forgot.php
Nuno
----- Original Message ----- > Hi, all,>
Sorry for disturbing you.> I cant login in my account "mikespook" with the passwords that I set up > before.> I dont know if I type a wrong passwords or I need more setup with the> cvs client as SSL etc.> Another problem is how I can modify my password with the cvs account.> Thanks and Regards!> Mike -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
|
| | Add comment |
|
| one click - two actions? Mel 13:34:23 |
| | Could someone please help me figure out how to show some description (where applicable) at the same time as I show an image, when I click on a link, without repeating the entire query? The image and the description are both in the same table in my database.
I now show the image when I click on the link which is good, but the description stays on at all times instead of appearing only when active.
http://www.squareinch.net/single_page.php
This is the code I have for the image area: /* query 1 from client */ $query = "SELECT * FROM client where status='active' or status='old' order by companyName";
$result = mysql_query($query) or die ("Couldn't execute query");
while ($aaa = mysql_fetch_array($result,MYSQL_ASSOC)) { echo "<span class='navCompany'>{$aaa['companyName']}</span><span class='navArrow'> > </span>\n";
/* query 2 from job */ $query = "SELECT * FROM job WHERE companyId='{$aaa['companyId']}'"; $result2 = mysql_query($query) or die ("Couldn't execute query2");
foreach($aaa as $jobType) { $bbb = mysql_fetch_array($result2,MYSQL_ASSOC); echo "<span class='navText'><a href='single_page.php?art=".$bbb ['pix']."'>{$bbb['jobType']}</a></span>\n"; } echo "<br>"; } ?>
</div>
<div class="navbox3"><?php $image = $_GET['art']; ?> <img src="images/<?php print ($image) ?>" alt="Portfolio Item" border="0" width="285" height="285"></div>
This is the code I have for the description area:
/* query 1 from client */ $query = "SELECT * FROM client where status='active' or status='old' order by companyName";
$result = mysql_query($query) or die ("Couldn't execute query");
while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) {
/* query 2 from job */ $query = "SELECT * FROM job WHERE companyId='{$row['companyId']}'"; $result2 = mysql_query($query) or die ("Couldn't execute query2"); $url = mysql_query($result2);
foreach($row as $url) { $row = mysql_fetch_array($result2,MYSQL_ASSOC); if ("url={$row['url']}") echo "<span class='navText'><a href='{$row['url']}'>{$row['web']}</ a></span>"; }
echo "<br>"; } ?>
|
| | 12 answers | Add comment |
|
| Php / MySQL DESC tablename Beauford 13:25:08 |
| | Hi,
First off thanks to everyone for the previous help. I managed to get it sorted out and used several of the suggestions made.
I am trying to do a DESC table_name using PHP so it looks like it would it you did it from the command line.
i.e.
| Field | Type | Null | Key | Default | Extra | +-----------+--------------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | name | varchar(30) | NO | | NULL | |
What I have found is that the following does not work the way I would have thought.
$query = "DESC table ".$currenttb; $result = mysql_query($query);
while ($row = mysql_fetch_row($result)) { etc.....
I have found something that works, but it is still not like the above and is really bulky. I can not get the type (varchar, etc) to show like above, it will show string, blob, etc, and the last problem is it puts the last 4 fields in one variable (flags).
Does anyone know of a way to get this to output as shown above. I am putting this into a form for editing, so I need everything in the proper places.
Thanks
Here is the entire code:
mysql_select_db($_SESSION['currentdb']);
$result = mysql_query("SELECT * FROM ".$_SESSION['currenttb']); $fields = mysql_num_fields($result); $rows = mysql_num_rows($result); $table = mysql_field_table($result, 0);
for ($i=0; $i < $fields; $i++) { $type = mysql_field_type($result, $i); $name = mysql_field_name($result, $i); $len = mysql_field_len($result, $i); $flags = mysql_field_flags($result, $i); echo all the filds.... }
This outputs (depending on the order you echo them):
username string 50 [not_null primary_key auto_increment] value in [] is one value.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 1 answer | Add comment |
|
| PHP Warning: session_destroy Andre Dubuc 13:11:11 |
| | Hi,
To stop bots from accessing secured pages, I've added the following code to a banner page that is called by every page. Furthermore, each page starts with <?php session_start(); ?> and includes the banner page:
'top1.php' [banner page]
<?php if((eregi("((Yahoo! Slurp|Yahoo! Slurp China|.NET CLR|Googlebot/2.1| Gigabot/2.0|Accoona-AI-Agent))",$_SERVER['HTTP_USER_AGENT']))) { if ($_SERVER['HTTPS'] == "on") { session_destroy(); header("Location: http://localhost/logout.php"); } } ?>
I'm testing on localhost with the browser set to 'Googlebot/2.1' - and the code works great. Any page that is set for https is not served, and if https has been set by a previous visit, it goes to http://somepage.
However, checking the live version, I get an secure-error_log entry:
"PHP Warning: session_destroy() [<a href='function.session-destroy'>function.session-destroy</a>]: Trying to destroy uninitialized session"
Question is: didn't the session_start(); on the calling page take effect, or is this some other problem?
Is there something like 'isset' to check whether 'session_destroy(); is needed? [I've tried isset, it barfs the code.]
Tia, Andre
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 4 answer | Add comment |
|
| non-blocking request to a url (via curl or file_get_contents or whatever)... Jochem Maas 12:56:55 |
| | hi,
I have a tradedoubler webbug to implement in site - not a problem as such - but I have a slight issue when it comes to online payments.
I have an order processing page that is requested *directly* by an online payment service in order to tell the site/system that a given order has successfully completely, this occurs prior to the online payment service redirecting the user back to my site...
at the end of the order processing the order (basically the order is marked as completed) is removed from the session in such a way that there is no longer anyway to know details about the order, so by the time the user comes back to the site I don't have the required info to create the required webbug url...
which led me to the idea/conclusion that I must (in the case of successful online payments) generate the webbug url in the order processing page while the relevant order details are still available and then make a request to the webbug url directly from the server...
I could make this request by simply doing this:
file_get_contents($webbugURL);
but this would block until the data was returned, but I don't want to wait for a reply and I definitely give a hoot about the content returned ... all I want is for the request to go out on the wire and then have my script immediately continue with what it should be doing.
I believe this would require creating a non-blocking connection in some way, but I'm stuck as to the correct way to tackle this. I've been reading about non-blocking sockets/streams etc but I'm just becoming more and more confused really, anyone care to put me out of my misery?
rgds, Jochem
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 8 answers | Add comment |
|
| Read Karl James 07:30:39 |
| | |
| | 6 answers | Add comment |
|
| easter_date() Oliver Block 00:37:16 |
| | Hello,
after a failed test of the easter_date() function I've taken a look at the test file. The test file sets the default timezone to UTC.
To make it short:
easter_date() does not return correct results, if the default timezone (set with date_default_timezone_set() or INI date.timezone) is "left" of the local timezone, i.e. the UTC offset is less than the UTC offset of the local timezone. (The local timezone is determined by the computer that runs the test.)
To illustrate it:
The timezone on my computer is "Europe/Berlin" which is UTC +200 (+ 2 hours) according to php. If easter_date() is called on a timezone with an UTC offset < +200 you will always get one day less, e.g. 2000-04-22 instead of the correct result 2000-04-23. That is because at 2000-04-23T00:00:00 (midnight) you have 2000-04-22 on every timezone with an offset < +200).
Regards,
Oliver
-- PHP Quality Assurance Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
|
| | Add comment |
Saturday, 20 January 2007
|
| [PHP-DEV] PHP Cross Compilation for Arm Kiran Malla 22:23:34 |
| | Hello,
I am trying to cross compile PHP-5.2.0 for arm linux.
# export CC=/usr/local/arm/3.3.2/bin/arm-linux-gcc # export AR=/usr/local/arm/3.3.2/bin/arm-linux-ar # export LD=/usr/local/arm/3.3.2/bin/arm-linux-ld # export NM=/usr/local/arm/3.3.2/bin/arm-linux-nm # export RANLIB=/usr/local/arm/3.3.2/bin/arm-linux-ranlib # export STRIP=/usr/local/arm/3.3.2/bin/arm-linux-strip
# ./configure --host=arm-linux --sysconfdir=/etc/appWeb --with-exec-dir=/etc/appWeb/exec
Result of this configure is, . . .
Checking for iconv support... yes checking for iconv... no checking for libiconv... no checking for libiconv in -liconv... no checking for iconv in -liconv... no configure: error: Please reinstall the iconv library.
I have installed libiconv-1.11 on my system. The command 'which iconv' shows '/usr/local/bin/iconv'. I have no clue why configure is failing due to missing iconv.
Please throw some light on this issue. What are all the flags and variables to set to cross compile PHP for arm? If anyone has tried php on arm linux, please let me know the steps.
Regards,
|
| | 1 answer | Add comment |
|
| Storing values in arrays Ryan A 19:26:39 |
| | Hi,
I think its easier to explain what I want to do.. so here goes: I want to store values in arrays for one minute and then write them to file.
For example, everytime someone logs in I want their username to be in an array.... 1 or 100 or X people may login in 60 seconds...but it should only write all the usernames that logged in to disk every 1 minute.
Ideas? suggestions? starting points or a link to a specific spot in the manual with a RTFM would be appreciated
Thanks in advance, Ryan
------ - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! - Smile, everyone loves a moron. --------------------------------- It's here! Your new message! Get new email alerts with the free Yahoo! Toolbar. |
| | 12 answers | Add comment |
|
| nuSoap -method '' not defined in service Blackwater Dev 19:22:07 |
| | I have the following code but when I hit the page, I get the xml error of method '' not defined in service. I don't have a wsdl or anything defined. Is there more I need to do to get the SOAP service set up?
Thanks!
include("nusoap/nusoap.php");
$server=new soap_server(); $server->register('getColumns');
function getColumns(){
$search= new carSearch();
return $search->getSearchColumns();
} $server->service($HTTP_RAW_POST_DATA);
|
| | 2 answer | Add comment |
|
| email validation string. Don 18:11:16 |
| | I'm trying to get this line to validate an email address from a form and it isn't working.
if (ereg("^.+@.+\..+$",$submittedEmail))
The book I'm referencing has this line
if (ereg("^.+@.+\\..+$",$submittedEmail))
Anyway.. I welcome any advice as long as it doesn't morph into a political debate on ADA standards and poverty in Africa.
Thanks
Don
|
| | 19 answers | Add comment |
|
| Going back with multiple submits to the same page Otto Wyss 17:26:18 |
| | When values are entered on one of my page I submit the result back to the same page (form action=same_page). Unfortunately each submit adds an entry into the history, so history back doesn't work in a single step. Yet if the count of submits were known I could use goto(n). What's the best way to get this count? PHP or Javascript?
O. Wyss
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 5 answers | Add comment |
|
| Need tool to graphically show all includes/requires Daevid Vincent 16:57:19 |
| | We have a fairly complex product that is all PHP based GUI.
We're in need of some kind of "graphical tool" (web, stand alone, windows, linux, osx whatever) that will take a directory tree, recursively traverse all the files, look for 'includes' and 'requires' (and the _once versions too) and then map them out so we can see what files are calling what and where.
Anyone suggest something?
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 3 answer | Add comment |
|
| Get the shortened browser / HTTP_USER_AGENT Wikus Moller 12:36:14 |
| | Hi.
I want to strip everything after a / in the HTTP_USER_AGENT for example: Opera 9.10/blah/blah would become only Opera 9.10
Lets say $user = $_SERVER["HTTP_USER_AGENT"]; $browser = ("/", $user);
Is this correct? Isn't something needed in the browser variable?
Thanks Wikus
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 1 answer | Add comment |
|
| [PHP-DEV] link error on VC6 Ard Biesheuvel 11:00:33 |
| | Guys,
This is what I get when I try to build on VC6. It appears that the /nodefaultlib:libcmt prevents the linker from pulling in libcmt because resolv.lib references it. The resolv.lib is the one from the php_build.zip archive.
Do I need another resolv.lib that is linked to the right C-lib ??
Any ideas ?
-- Ard
Searching Libraries Searching C:\Program Files\Microsoft Visual Studio\VC98\lib\OLEAUT32.LIB: Searching C:\Program Files\Microsoft Visual Studio\VC98\lib\libxml2_a.lib: Searching C:\Program Files\Microsoft Visual Studio\VC98\lib\iconv_a.lib: Searching C:\Program Files\Microsoft Visual Studio\VC98\lib\odbc32.lib: Searching C:\Program Files\Microsoft Visual Studio\VC98\lib\odbccp32.lib: Searching C:\Program Files\Microsoft Visual Studio\VC98\lib\zlib.lib: Searching C:\Program Files\Microsoft Visual Studio\VC98\lib\kernel32.lib: Searching C:\Program Files\Microsoft Visual Studio\VC98\lib\ole32.lib: Searching C:\Program Files\Microsoft Visual Studio\VC98\lib\user32.lib: Searching C:\Program Files\Microsoft Visual Studio\VC98\lib\advapi32.lib: Searching C:\Program Files\Microsoft Visual Studio\VC98\lib\shell32.lib: Searching C:\Program Files\Microsoft Visual Studio\VC98\lib\ws2_32.lib: Searching C:\Program Files\Microsoft Visual Studio\VC98\lib\resolv.lib: Searching C:\Program Files\Microsoft Visual Studio\VC98\lib\msvcrt.lib: Searching C:\Program Files\Microsoft Visual Studio\VC98\lib\OLDNAMES.lib: Searching C:\Program Files\Microsoft Visual Studio\VC98\lib\uuid.lib: Searching C:\Program Files\Microsoft Visual Studio\VC98\lib\OLEAUT32.LIB: Searching C:\Program Files\Microsoft Visual Studio\VC98\lib\libxml2_a.lib: Searching C:\Program Files\Microsoft Visual Studio\VC98\lib\iconv_a.lib: Searching C:\Program Files\Microsoft Visual Studio\VC98\lib\odbc32.lib: Searching C:\Program Files\Microsoft Visual Studio\VC98\lib\odbccp32.lib: Searching C:\Program Files\Microsoft Visual Studio\VC98\lib\zlib.lib: Searching C:\Program Files\Microsoft Visual Studio\VC98\lib\kernel32.lib: Searching C:\Program Files\Microsoft Visual Studio\VC98\lib\ole32.lib: Searching C:\Program Files\Microsoft Visual Studio\VC98\lib\user32.lib: Searching C:\Program Files\Microsoft Visual Studio\VC98\lib\advapi32.lib: Searching C:\Program Files\Microsoft Visual Studio\VC98\lib\shell32.lib: Searching C:\Program Files\Microsoft Visual Studio\VC98\lib\ws2_32.lib: Searching C:\Program Files\Microsoft Visual Studio\VC98\lib\resolv.lib: Searching C:\Program Files\Microsoft Visual Studio\VC98\lib\msvcrt.lib:
Done Searching Libraries Creating library Release_TS\php5ts.lib and object Release_TS\php5ts.exp
Searching Libraries Searching C:\Program Files\Microsoft Visual Studio\VC98\lib\OLEAUT32.LIB: Searching C:\Program Files\Microsoft Visual Studio\VC98\lib\libxml2_a.lib: Searching C:\Program Files\Microsoft Visual Studio\VC98\lib\iconv_a.lib: Searching C:\Program Files\Microsoft Visual Studio\VC98\lib\odbc32.lib: Searching C:\Program Files\Microsoft Visual Studio\VC98\lib\odbccp32.lib: Searching C:\Program Files\Microsoft Visual Studio\VC98\lib\zlib.lib: Searching C:\Program Files\Microsoft Visual Studio\VC98\lib\kernel32.lib: Searching C:\Program Files\Microsoft Visual Studio\VC98\lib\ole32.lib: Searching C:\Program Files\Microsoft Visual Studio\VC98\lib\user32.lib: Searching C:\Program Files\Microsoft Visual Studio\VC98\lib\advapi32.lib: Searching C:\Program Files\Microsoft Visual Studio\VC98\lib\shell32.lib: Searching C:\Program Files\Microsoft Visual Studio\VC98\lib\ws2_32.lib: Searching C:\Program Files\Microsoft Visual Studio\VC98\lib\resolv.lib: Searching C:\Program Files\Microsoft Visual Studio\VC98\lib\msvcrt.lib: Searching C:\Program Files\Microsoft Visual Studio\VC98\lib\OLDNAMES.lib: Searching C:\Program Files\Microsoft Visual Studio\VC98\lib\uuid.lib:
Done Searching Libraries resolv.lib(inet_addr.obj) : error LNK2001: unresolved external symbol __pctype resolv.lib(inet_addr.obj) : error LNK2001: unresolved external symbol ___mb_cur_max Release_TS\php5ts.dll : fatal error LNK1120: 2 unresolved externals NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\VC98\bin\link.exe"' : return code '0x460' Stop. NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\VC98\bin\NMAKE.EXE"' : return code '0x2' Stop.
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php |
| | 1 answer | Add comment |
|
| multidimensional array problems Nitrox Doe 00:37:08 |
| | hi all, im very new to php but i think i jumped on the toughest thing to learn. Im trying to create a team roster that will show game, game type and league and then show each member based on the game type. Ive worked out alot of code but just cant figure where im going wrong. so here is my code. Any pointers would be greatly appreciated.
this is an example of what im trying to do http://www.chalkthree.com/exampleroster.html
php code <?php //begin member league table $memroster = "SELECT inf_league.game, inf_league.type, inf_member.user_name, inf_member.rank, " . "inf_member.country, inf_member.email " . "FROM inf_league " . "INNER JOIN inf_memberleague ON inf_league.gid = inf_memberleague.l_id " . "INNER JOIN inf_member ON inf_member.user_id = inf_memberleague.m_id"; $memrosterresults = mysql_query($memroster) or die(mysql_error()); while ($row = mysql_fetch_array($memrosterresults)) {
foreach ($row as $game => $type) { echo "<p>"; echo "$type"; foreach ($row as $type => $user_name) { echo "$user_name" . " - " . "$rank" . " - " . "$country" . " - " . "$email"; } print '</p>'; } } //end member league table ?>
mysql
CREATE TABLE `inf_league` ( `gid` int(11) NOT NULL auto_increment, `game` varchar(255) NOT NULL, `type` varchar(255) NOT NULL, `league` varchar(255) NOT NULL, `season` varchar(255) NOT NULL, PRIMARY KEY (`gid`)) TYPE=MyISAM AUTO_INCREMENT=4 ;-- -- Dumping data for table `inf_league`-- INSERT INTO `inf_league` (`gid`, `game`, `type`, `league`, `season`) VALUES (1, 'DF:BHD', 'TKOTH', 'TWL', '2006 1st Quarter');INSERT INTO `inf_league` (`gid`, `game`, `type`, `league`, `season`) VALUES (2, 'CoD2', 'CTF', 'TWL', '2006 2nd QTR');INSERT INTO `inf_league` (`gid`, `game`, `type`, `league`, `season`) VALUES (3, 'CoD2', 'Search & Destroy', 'CAL', '2006 4th QTR');-- ---------------------------------------------------------- -- Table structure for table `inf_member`-- CREATE TABLE `inf_member` ( `user_id` int(11) NOT NULL auto_increment, `user_level` int(2) NOT NULL default '0', `list_order` int(3) NOT NULL default '0', `user_name` varchar(100) NOT NULL default '', `password` varchar(25) NOT NULL default '', `email` varchar(100) NOT NULL default '', `country` text NOT NULL, `game` text, `rank` varchar(40) default NULL, `qoute` longtext, `config` int(1) default '0', `map` varchar(100) default '', `gun` varchar(100) default '', `brand` varchar(100) default '', `cpu` varchar(20) default '', `ram` varchar(20) default '', `video` varchar(100) default '', `sound` varchar(100) default '', `monitor` varchar(100) default '', `mouse` varchar(100) default '', PRIMARY KEY (`user_id`)) TYPE=MyISAM AUTO_INCREMENT=3 ;-- -- Dumping data for table `inf_member`-- INSERT INTO `inf_member` (`user_id`, `user_level`, `list_order`, `user_name`, `password`, `email`, `country`, `game`, `rank`, `qoute`, `config`, `map`, `gun`, `brand`, `cpu`, `ram`, `video`, `sound`, `monitor`, `mouse`) VALUES (1, 1, 0, 'nitrox', 'test', 'itsme@me.com', 'United States', 'CoD2', 'Founder', NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);INSERT INTO `inf_member` (`user_id`, `user_level`, `list_order`, `user_name`, `password`, `email`, `country`, `game`, `rank`, `qoute`, `config`, `map`, `gun`, `brand`, `cpu`, `ram`, `video`, `sound`, `monitor`, `mouse`) VALUES (2, 1, 1, 'raze', 'itsme', 'itsyou@itsyou.com', 'United States', NULL, 'Leader', NULL, 0, '', '', '', '', '', '', '', '', '');-- ---------------------------------------------------------- -- Table structure for table `inf_memberleague`-- CREATE TABLE `inf_memberleague` ( `l_id` int(4) NOT NULL, `m_id` int(4) NOT NULL) TYPE=MyISAM;-- -- Dumping data for table `inf_memberleague`-- INSERT INTO `inf_memberleague` (`l_id`, `m_id`) VALUES (1, 2);INSERT INTO `inf_memberleague` (`l_id`, `m_id`) VALUES (1, 1);INSERT INTO `inf_memberleague` (`l_id`, `m_id`) VALUES (2, 1);INSERT INTO `inf_memberleague` (`l_id`, `m_id`) VALUES (2, 2);
_________________________________________________________________ Get live scores and news about your team: Add the Live.com Football Page www.live.com/?addtemplate=football&icid=T001MSN30A0701
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 5 answers | Add comment |
|
| [PHP-Win] Installing PHP 5.2 gives PHP warning. Martijn Cremer 00:37:08 |
| | Hello,
I installed PHP 5.2 on a clean Windows XP sp2 machine with Apache 2.2. Now the problem is Php gives a lot of errors and then crashes:
All the errors start with "PHP Warning: PHP Startup: Unable to load dynamic library"
It seems php cant find any of the modules set in the extension directory. First I toucht it was bc I maybe had old extensions and A removed them all and download them again. Just to be sure. But Even after doing that PHP keeps giving that it cant find the dynamic library.
I used the MSI installer found on php.net. Any ideas what can cause this?
-- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 4 answer | Add comment |
|
| Where can I get the Printer extension? Chuck Anderson 00:09:48 |
| | It thought it would be bundled with my Windows version pf Php 4.4.1, but it is not.
I've searched for it and can't find it at php.net.
How do get a copy of php_printer.dll for Php4.4.1 for Windows?
-- ***************************** Chuck Anderson Boulder, CO http://www.CycleTourist.com *****************************
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 4 answer | Add comment |
|