PHP - Possible To Merge These And Also Can This Code Display A Subtotal If So How?
So currently I have 2 files that pretty much does the same thing but connects to 2 different tables. I sort of want to merge it together to save file space and make everything more efficient:
Similar TutorialsHi, I have a very basic page that puts a list of dates from a mysql database into a list in order of date like this... Code: [Select] echo' <h1>Gigs</h1> <table width=\"400\" height=\"200\" >'; while($row = mysql_fetch_array($result, MYSQL_ASSOC)) {echo "<form action=\"giglist_private_update.php\" method=\"post\">". " <tr> <td style=\"height:80px; width:80px;\"valign=\"top\"> <img height=\"79px\" width=\"79px\" valign=\"top\" alt=\"calendarpic\" style=\"position:absolute; vertical-align:top; z-index:1;\" src=\"calpics/{$row['background']}.png\"/> <img height=\"79px\" width=\"79px\" valign=\"top\" alt=\"calendarpic1\" style=\"position:absolute; vertical-align:top; z-index:2;\" src=\"calpics/{$row['day']}.png\"/> <img height=\"79px\" width=\"79px\" valign=\"top\" alt=\"calendarpic2\" style=\"position:absolute; vertical-align:top; z-index:3;\" src=\"calpics/{$row['month']}.png\"/></td>". "<td colspan=\"3\"><font size=\"4\"><strong>{$row['gl_venue']} {$row['gl_city']}, {$row['gl_postcode']} </td><td>{$row['pf']}{$row['publish']}{$row['unavailable']}</td>". "<td colspan=\"2\"><a href=\"http://maps.google.co.uk/maps?f=q&source=s_q&hl=en&geocode=&q={$row['gl_postcode']}\">Map</a></td><td>". "<form action=\"giglist_private_entry.php\" method=\"post\">". "<td display=\"none\"><td><input type=\"hidden\" name=\"gl_date\" value=\"{$row['gl_date']}\"></td>". "<td display=\"none\"><td><input type=\"hidden\" name=\"gl_venue\" value=\"{$row['gl_venue']}\"></td>". "<td display=\"none\"><td><input type=\"hidden\" name=\"gl_postcode\" value=\"{$row['gl_postcode']}\"></td>". "<td display=\"none\"><td><input type=\"hidden\" name=\"gl_city\" value=\"{$row['gl_city']}\"></td>". "<td display=\"none\"><td><input type=\"hidden\" name=\"gl_phone\" value=\"{$row['gl_phone']}\"></td>". "<td display=\"none\"><td><input type=\"hidden\" name=\"gl_contact\" value=\"{$row['gl_contact']}\"></td>". "<td display=\"none\"><td><input type=\"hidden\" name=\"gl_net\" value=\"{$row['gl_net']}\"></td>". "<td display=\"none\"><td><input type=\"hidden\" name=\"gl_comments\" value=\"{$row['gl_comments']}\"></td>". "<td display=\"none\"><td><input type=\"hidden\" name=\"gl_text\" value=\"{$row['gl_text']}\"></td>". "<td display=\"none\"><td><input type=\"hidden\" name=\"gl_pf\" value=\"{$row['gl_pf']}\"></td>". "<td display=\"none\"><td><input type=\"hidden\" name=\"gl_id\" value=\"{$row['gl_id']}\"></td>". "<td display=\"none\"><td><input type=\"hidden\" name=\"gl_unavailable\" value=\"{$row['gl_unavailable']}\"></td>". "<td display=\"none\"><td><input type=\"hidden\" name=\"gl_next_gig\" value=\"{$row['gl_next_gig']}\"></td>". "<td display=\"none\"><td><input type=\"hidden\" name=\"gl_publish\" value=\"{$row['gl_publish']}\"></td>". "<td><input type=\"submit\" value=\"Details\">" ; } echo '<tr style=\"height:40px\"></tr></tr></table><br><br>'; The hidden fields post the details from the query to memory so they can be displayed on an 'edit' page. How do I go about grouping this list by month?? My instincts are telling me to create a field in the mysql query that returns the month (month(gl_date) with a case statement for '1='January' etc). Then what do I do.......is it an array of arrays? how do I code that? I have the following code in html: <html> <head> <script type="text/javascript"> <!-- function delayer(){ window.location = "http://VARIABLEVALUE.mysite.com" } //--> </script> <title>Redirecting ...</title> </head> <body onLoad="setTimeout('delayer()', 1000)"> <script type="text/javascript"> var sc_project=71304545; var sc_invisible=1; var sc_security="9c433fretre"; </script> <script type="text/javascript" src="http://www.statcounter.com/counter/counter.js"></script><noscript> <div class="statcounter"><a title="vBulletin statistics" href="http://statcounter.com/vbulletin/" target="_blank"><img class="statcounter" src="http://c.statcounter.com/71304545/0/9c433fretre/1/" alt="vBulletin statistics" ></a></div></noscript> </body> </html> Is a basic html webpage with a timer redirect script and a stascounter code. I know a bit about html and javascript, but almost nothing about php. My question is: How a can convert this html code into a php file, in order to send a variable value using GET Method and display this variable value inside the javascript code where says VARIABLEVALUE. Thanks in adavance for your help. Hello, I've created a PHP file to merge XML files by ReferenceID(product_print_id) but i don't get the result that i want. I think i must use cloneNode and DOMNode::insertBefore but I think i'm lost. The first file is prodInfo.xml: <?xml version="1.0" encoding="utf-8"?> <PRODUCTINFORMATION> <PRODUCTS> <PRODUCT> <PRODUCT_NUMBER>53-03</PRODUCT_NUMBER> <PRODUCT_PRINT_ID>42</PRODUCT_PRINT_ID> <PRODUCT_NAME>ProductFirst</PRODUCT_NAME> <COLOR_CODE>03</COLOR_CODE> </PRODUCT> </PRODUCTS> </PRODUCTINFORMATION> and the second file is printInfo.xml: <?xml version="1.0" encoding="utf-8"?> <PRINTINGINFORMATION> <PRODUCTS> <PRODUCT> <PRODUCT_PRINT_ID>42</PRODUCT_PRINT_ID> <PRINTING_POSITIONS> <PRINTING_POSITION> <ID>TOP BOX</ID> <PRINTING_TECHNIQUE> <ID>DL</ID> </PRINTING_TECHNIQUE> <PRINTING_TECHNIQUE> <ID>L2</ID> </PRINTING_TECHNIQUE> <PRINTING_TECHNIQUE> <ID>P4</ID> </PRINTING_TECHNIQUE> </PRINTING_POSITION> </PRINTING_POSITIONS> </PRODUCT> </PRODUCTS> </PRINTINGINFORMATION> The php file i created is the following: <?php header ("Content-Type:text/xml"); $target = new DOMDocument(); $target->preserveWhiteSpace = FALSE; $target->load('prodInfo.xml'); $targetXpath = new DOMXpath($target); $source = new DOMDocument(); $source->load('printInfo.xml'); $sourceXpath = new DOMXpath($source); foreach ($targetXpath->evaluate('//PRODUCT') as $PRODUCTNode) { $PRODUCT_PRINT_ID = $targetXpath->evaluate('string(PRODUCT_PRINT_ID)', $PRODUCTNode); foreach ($sourceXpath->evaluate('//PRODUCT[PRODUCT_PRINT_ID="'.$PRODUCT_PRINT_ID.'"]/*[not(self::PRODUCT_PRINT_ID)]') as $node) { $PRODUCTNode->appendChild( $target->importNode($node, TRUE) ); } } $target->formatOutput = TRUE; echo $target->saveXml(); ?> The output/result i get is this: <?xml version="1.0" encoding="utf-8"?> <PRODUCTINFORMATION> <PRODUCTS> <PRODUCT> <PRODUCT_NUMBER>53-03</PRODUCT_NUMBER> <PRODUCT_PRINT_ID>42</PRODUCT_PRINT_ID> <PRODUCT_NAME>ProductFirst</PRODUCT_NAME> <COLOR_CODE>03</COLOR_CODE> <PRINTING_POSITIONS> <PRINTING_POSITION> <ID>TOP BOX</ID> <PRINTING_TECHNIQUE> <ID>DL</ID> </PRINTING_TECHNIQUE> <PRINTING_TECHNIQUE> <ID>L2</ID> </PRINTING_TECHNIQUE> <PRINTING_TECHNIQUE> <ID>P4</ID> </PRINTING_TECHNIQUE> </PRINTING_POSITION> </PRINTING_POSITIONS> </PRODUCT> </PRODUCTS> </PRODUCTINFORMATION> But what i want to achieve is this: <?xml version="1.0" encoding="utf-8"?> <PRODUCTINFORMATION> <PRODUCTS> <PRODUCT> <PRODUCT_NUMBER>53-03</PRODUCT_NUMBER> <PRODUCT_PRINT_ID>42</PRODUCT_PRINT_ID> <PRODUCT_NAME>ProductFirst</PRODUCT_NAME> <PRINTING_POSITIONS> <PRINTING_POSITION> <ID>TOP BOX</ID> <PRINTING_TECHNIQUE> <ID>DL</ID> </PRINTING_TECHNIQUE> <COLOR_CODE>03</COLOR_CODE> </PRINTING_POSITION> <PRINTING_POSITION> <ID>TOP BOX</ID> <PRINTING_TECHNIQUE> <ID>L2</ID> </PRINTING_TECHNIQUE> <COLOR_CODE>03</COLOR_CODE> </PRINTING_POSITION> <PRINTING_POSITION> <ID>TOP BOX</ID> <PRINTING_TECHNIQUE> <ID>P4</ID> </PRINTING_TECHNIQUE> <COLOR_CODE>03</COLOR_CODE> </PRINTING_POSITION> </PRINTING_POSITIONS> </PRODUCT> </PRODUCTS> </PRODUCTINFORMATION> So as you can see i want to repeat the field PRINTING POSITION ID for every PRINTING TECHNIQUE and also i want to repeat the field COLOR CODE for every PRINTING POSITION. Anyone can help me with this? Thanks in advance. i want to preserve the numeric keys. When i print the array this is the result Code: [Select] Array ( [0] => one [1] => two [2] => three ) it should be Code: [Select] Array ( [0] => two [1] => one [2] => three ) Code: [Select] $test1[2] = "one"; $test2[1] = "two"; $test2[3] = "three"; $test = array_merge($test1,$test2); print_r($test); How do i solve this? How can I merge the array, but I keep in mind that I only need to merge userlocation and the usercity arrays. Current output... Code: [Select] Array ( [0] => Array ( [0] => userlocation [1] => 19 ) [1] => Array ( [0] => credentials [1] => ) [2] => Array ( [0] => specialties [1] => ) [3] => Array ( [0] => usercity [1] => place1 ) ) Desired output... Code: [Select] Array ( [0] => Array ( [0] => userlocation [1] => 19 [2] => usercity [3] => place1 ) [1] => Array ( [0] => credentials [1] => ) [2] => Array ( [0] => specialties [1] => ) ) How can this be done? The array is dynamic. i have this list of arrays Code: [Select] Array ( [0] => LeanBiz ) Array ( [0] => Boutique ) Array ( [0] => Feather ) Array ( [0] => Aggregate )i want to create one single array containing the values from x arrays. I have loaded two similar xml files by simplexml_load_file, and I want to merge them. They have similar structure and I want to put them into a single xml. As a matter of fact, I have parse two similar xml files with foreach, and now I want to put them together and use one foreach for the merged xml. I hope to find a function like array_merge() Hi, I'm trying to make my game navigation that involves switching div images to navigate in the game world. It is browser based. The first script, the user clicks on the world map to go to "Teardrop Ocean". The second script lets the user press the "further" button or "back" button to navigate within "Teardrop Ocean". My problem is I'm trying to combine the image map navigation with the "further" and "back" navigation. The problem is, I don't know if it's possible since the first world map script involves javascript. Here is the code, any help greatly appreciated Thanks. Derek This is the code that uses javascript to process a hidden form to use php to output. This is our "world map" link, that should load the "teardrop ocean" image inside the div, which it doesn't do yet here. Code: [Select] <?php $zone=''; if(isset($_POST['checker']) && $_POST['checker'] == 'checked') { echo "it worked !"; $zone="<img src='teardrop.jpg'/>"; } if(isset($_POST['back'])) { $zone=''; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <form action="aradia.php" method="post" name="mapform" id="mapform"> <input type="hidden" name="checker" value="checked" /> <div align="left"> <img src="aradia.jpg" width="256" height="328" border="0" usemap="#Map" /></div> </form> <map name="Map" id="Map"> <area shape="rect" coords="5,176,81,249" href="javascript: void(0);" onclick="javascript: document.getElementById('mapform').submit();" /> </map> <div align="center"><?php echo $zone;?></div> <form action="aradia.php" method="post" > <input type = "submit" name="back" value="back" /></form> </body> </html> and here is the "Teardrop ocean" navigation, which uses php to navigate forward and backwards in the zone, but can't go back to the world map, or there is no way to yet. Code: [Select] /////////////////////////////GAME NAVIGATION AND MONSTER SEARCH CODE NOT FINISHED////////////////////////////////// if(( !isset($_SESSION['current_background']) && !isset($_SESSION['currentMonster'])) OR (! $_POST)) { $_SESSION['current_monster'] = 0; $_SESSION['current_background'] = 0; } if (!isset($_SESSION['background']) && !isset($_SESSION['monster'])) { $_SESSION['background'] = array ( "<img src='sundragon_environments/ocean/ocean1_FRAME.jpg'/>", "<img src='sundragon_environments/ocean/ocean1_FRAME2.jpg'/>", "<img src='sundragon_environments/ocean/ocean1_FRAME3.jpg'/>", "<img src='sundragon_environments/ocean/ocean1_FRAME4.jpg'/>", "<img src='sundragon_environments/ocean/ocean1_FRAME5.jpg'/>" ); $_SESSION['monster'] = array ( "<img src='sundragon_monsters_source/water/goldfish/goldfish.png'/>", "<img src='sundragon_monsters_source/water/eel/eel_transp_FRAME.png '/>", "<img src='sundragon_monsters_source/water/shark/shark_transp_FRAME.png'/>", "<img src='sundragon_monsters_source/water/octalisk/octalisk_transp_FRAME.png'/>", "<img src='sundragon_monsters_source/water/teardrop_ocean_protector/teardrop_ocean_protector.png'/>" ); } if(!isset($_SESSION['current_background']) && !isset($_SESSION['current_monster'])) { $_SESSION['current_monster']=0; $_SESSION['current_background'] = 0; } if(isset($_POST['further'])) { $_SESSION['current_monster'] = isset($_SESSION['monster'][$_SESSION['current_monster'] + 1]) ? ($_SESSION['current_monster'] + 1) : 0; $_SESSION['current_background'] = isset($_SESSION['background'][$_SESSION['current_background'] + 1]) ? ($_SESSION['current_background'] + 1) : 0; } elseif(isset($_POST['back'])) { $_SESSION['current_monster'] = isset($_SESSION['monster'][$_SESSION['current_monster'] - 1]) ? ($_SESSION['current_monster'] - 1) : count($_SESSION['monster'])-1; $_SESSION['current_background'] = isset($_SESSION['background'][$_SESSION['current_background'] - 1]) ? ($_SESSION['current_background'] - 1) : count($_SESSION['background'])-1; } $currentBackground=$_SESSION['background'][$_SESSION['current_background']]; $currentMonster=$_SESSION['monster'][$_SESSION['current_monster']]; and I echo out $currentBackground and $currentMonster in the main game div. Whats the array function to merge two or more similar patterns in a single array. $a = array('red','pink','red','green','blue'); Basically i need to combine "red" so the output will be red, pink, green, blue hello i need help on displaying php code on my website so people can come and just copy it but it wont let me display it Hi i made this script for uploading files and it works correctly... <div><h2>Uploaden</h2> <form enctype="multipart/form-data" action="upload.php" method="POST"> Kies een bestand om te uploaden: <input name="uploadedfile" type="file" /><br /> <input type="submit" value="Uploaden" /> </form> But i have a seperate file wich is called upload.php. <?php $target_path = "images/"; $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded"; } else{ echo "There was an error uploading the file, please try again!"; } ?> Is there any way i can combine those in one php file and so it will give the output on the same screen? If i combine them like below it works but the first time the page loads i get an error message... <div><h2>Uploaden</h2> <form enctype="multipart/form-data" action="index.php" method="POST"> Kies een bestand om te uploaden: <input name="uploadedfile" type="file" /><br /> <input type="submit" value="Uploaden" /> </form> <?php $target_path = "images/"; $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded"; } else{ echo "There was an error uploading the file, please try again!"; } ?> And this is the error message.... Notice: Undefined index: uploadedfile in C:\wamp\www\test\index.php on line 59 Notice: Undefined index: uploadedfile in C:\wamp\www\test\index.php on line 61 But when i upload a file everything is ok... Hi, Have a question regarding array handling / changes. I have the below posted array. I need to consolidation the "categoryId" & "categoryName" where the "id" have the same value e.g. 66, then remove the duplicates but keep the merged data. The new merged data could be stored under a key e.g. [categories] => Array ( [categoryId] = 28 [categoryName] = Game Drive [1] [categoryId] = 29 [categoryName] = Game Drive etc. Code: [Select] Array ( [0] => Array ( [id] => 66 [name] => Person Name [description] => Test Desc [webUrl] => www.nish.co.za [emailAddress] => abc@abc.co.za [telNumber] => 123123 [provinceId] => 3 [cityId] => 2 [creationDate] => 2010-09-27 17:42:55 [activated] => Y [categoryId] => 28 [provinceName] => Gauteng [cityName] => Johannesburg [categoryName] => Game Drives ) [1] => Array ( [id] => 66 [name] => Person Name [description] => Test Desc [webUrl] => www.nish.co.za [emailAddress] => abc@abc.co.za [telNumber] => 123123 [provinceId] => 3 [cityId] => 2 [creationDate] => 2010-09-27 17:42:55 [activated] => Y [categoryId] => 29 [provinceName] => Gauteng [cityName] => Johannesburg [categoryName] => Nature Reserve ) [2] => Array ( [id] => 66 [name] => Person Name [description] => Test Desc [webUrl] => www.nish.co.za [emailAddress] => abc@abc.co.za [telNumber] => 123123 [provinceId] => 3 [cityId] => 2 [creationDate] => 2010-09-27 17:42:55 [activated] => Y [categoryId] => 34 [provinceName] => Gauteng [cityName] => Johannesburg [categoryName] => Rehabilitation Centre ) [3] => Array ( [id] => 65 [name] => Person Name [description] => This is the true test [webUrl] => http://www.klil.com [emailAddress] => abc@abc.co.za [telNumber] => 12311231 [provinceId] => 3 [cityId] => 2 [creationDate] => 2010-09-26 19:33:14 [activated] => Y [categoryId] => 28 [provinceName] => Gauteng [cityName] => Johannesburg [categoryName] => Game Drives ) [4] => Array ( [id] => 65 [name] => Test Multiple Categ [description] => This is the true test [webUrl] => http://www.klil.com [emailAddress] => abc@abc.co.za [telNumber] => 12311231 [provinceId] => 3 [cityId] => 2 [creationDate] => 2010-09-26 19:33:14 [activated] => Y [categoryId] => 29 [provinceName] => Gauteng [cityName] => Johannesburg [categoryName] => Nature Reserve ) [5] => Array ( [id] => 65 [name] => Person Name [description] => Description Text [webUrl] => http://www.test.com [emailAddress] => abc@abc.co.za [telNumber] => 12311231 [provinceId] => 3 [cityId] => 2 [creationDate] => 2010-09-26 19:33:14 [activated] => Y [categoryId] => 34 [provinceName] => Gauteng [cityName] => Johannesburg [categoryName] => Rehabilitation Centre ) [6] => Array ( [id] => 64 [name] => Person Name [description] => Description Text [webUrl] => www.tree.com [emailAddress] => abc@abc.co.za [telNumber] => 1123123123 [provinceId] => 3 [cityId] => 1 [creationDate] => 2010-09-26 12:10:56 [activated] => Y [categoryId] => 28 [provinceName] => Gauteng [cityName] => Alexandra [categoryName] => Nature Walks ) [7] => Array ( [id] => 64 [name] => Person Name [description] => Description Text [webUrl] => www.tree.com [emailAddress] => abc@abc.co.za [telNumber] => 1123123123 [provinceId] => 3 [cityId] => 1 [creationDate] => 2010-09-26 12:10:56 [activated] => Y [categoryId] => 29 [provinceName] => Gauteng [cityName] => Alexandra [categoryName] => Nature Reserve ) [8] => Array ( [id] => 64 [name] => Person Name [description] => Description Text [webUrl] => www.tree.com [emailAddress] => abc@abc.co.za [telNumber] => 1123123123 [provinceId] => 3 [cityId] => 1 [creationDate] => 2010-09-26 12:10:56 [activated] => Y [categoryId] => 34 [provinceName] => Gauteng [cityName] => Alexandra [categoryName] => Rehabilitation Centre ) [9] => Array ( [id] => 63 [name] => Person Name [description] => Description Text [webUrl] => www.test.com [emailAddress] => abc@abc.co.za [telNumber] => 123123 [provinceId] => 5 [cityId] => 3 [creationDate] => 2010-09-26 09:58:41 [activated] => Y [categoryId] => 29 [provinceName] => Limpopo [cityName] => Bandelierkop [categoryName] => Nature Reserve ) ) Thanks in advance, Peter The queries merge ok and results are correct except I get a notice: "Notice: Use of undefined constant UNION - assumed 'UNION' in...."
But is UNION a constant or is the context wrong?
$query = $query1." ".UNION." ".$query2; $result = mysqli_query($dbcon, $query) or die('Error getting data'); $num_rows = mysqli_num_rows($result); I am using pieces of an array like this: $data['0']; $data['2']; $data['3']; and so on...I think up to around $data['70']; I need to take the values of $data['29'] through $data['64'] and combine them. (stumped) On top of that I have to comma separate those now combined values (stumped). Actuall Code: $handle = fopen("test.csv", "r"); while (($data = fgetcsv($handle, 5000, ",")) !== FALSE){ $needed = $data['29'] .", ". $data['30'] .", ".$data['31']; // ALL THE WAY TO $data['65'] } I know how to do it the long way, could someone help me shorten my work? Thank you for your help. I'd like to merge the following function into my main download page but can't figure out how to do it. I've modified the main download page to do the actual downloads but how to manage making the database entries for each download is the problem. I guess I could use a case statement at the end of download.php to set $l_filename then run the pdo sql code. mydownloader.php - Currently located in download directory <?php $php_scripts = '../../php/'; require $php_scripts . 'PDO_Connection_Select.php'; require $php_scripts . 'GetUserIpAddr.php'; function mydloader($l_filename=NULL) { $ip = GetUserIpAddr(); if (!$pdo = PDOConnect("foxclone_data")) { exit; } */ if( isset( $l_filename ) ) { header('Content-Type: octet-stream'); header("Content-Disposition: attachment; filename={$l_filename}"); header('Pragma: no-cache'); header('Expires: 0'); readfile($l_filename); /* $ext = pathinfo($l_filename, PATHINFO_EXTENSION); $stmt = $pdo->prepare("INSERT INTO download (address, filename,ip_address) VALUES (?, ?, inet_aton('$ip'))"); $stmt->execute([$ip, $ext]) ; $test = $pdo->query("SELECT lookup.id FROM lookup WHERE inet_aton('$ip') >= lookup.ipstart AND inet_aton('$ip') <= lookup.ipend"); $ref = $test->fetchColumn(); $ref = intval($ref); $stmt = $pdo->prepare("UPDATE download SET lookup_id = '$ref' WHERE address = '$ip'"); $stmt->execute() ; } else { echo "isset failed"; } } mydloader($_GET["f"]); exit;
<?PHP require_once("header.php"); ?> </head> <body> <?PHP require_once("navbar.php"); ?> <!--==================================================================== Download =======================================================================--> <?php $php_scripts = '../php/'; require $php_scripts . 'PDO_Connection_Select.php'; if (!$pdo = PDOConnect("foxclone_data")) { exit; } $test = $pdo->query("SELECT filename FROM files WHERE id =1"); $isoname = $test->fetchColumn(); $test = $pdo->query("SELECT md5 FROM files WHERE id =1"); $md5file = $test->fetchColumn(); $test = $pdo->query("SELECT filename FROM files WHERE id =2"); $pdfname = $test->fetchColumn(); $test = $pdo->query("SELECT filename FROM files WHERE id =3"); $debname = $test->fetchColumn(); $test = $pdo->query("SELECT md5 FROM files WHERE id =3"); $debmd5 = $test->fetchColumn(); $test = $pdo->query("SELECT filename FROM files WHERE id =4"); $srcname = $test->fetchColumn(); $test = $pdo->query("SELECT md5 FROM files WHERE id =4"); $srcmd5 = $test->fetchColumn(); $test = $pdo->query("SELECT filename FROM files WHERE id =5"); $debfile = $test->fetchColumn(); ?> <div class="head__h1">FoxClone Download Page</div> <div class ="download"> <div class="down__row"> <div class="down__column" style="background-color:#ddd;"> <div class="part__head">Get the "<?php echo "{$isoname}";?>" file (approx. 660MB)</div><br> <a href="download/{$isoname}";?>"><center><img src="images/download.png" style="height:44px; width:144px;" alt="download iso"> </center></a> <br /> <div class="part__head">The MD5sum is: <?php echo "{$md5file}";?> </div> <br/> <hr> <div class="part__head">Read or Download the Installation and Use Instructions </div><br> <a href="<?php echo "download/{$pdfname}";?>"><center><img src="images/download.png" style="height:44px; width:144px;" alt="download manual"></center></a><br> <hr> <div class="part__head">How To Install To A USB/CD</div> <div class="down__text">1. Download the iso file <br /> 2.<span class="tab">a. If burning to a USB stick use the USB image writer that comes with your distribution. </span> <br /> <span class="tab3">b. If burning to a CD, there are many Linux utilities, xfburn is one of the simplest. Install from your software manager/centre if not installed.</span> </div> <hr> <div class="part__head">How To Boot The USB/CD</div> <div class="down__text">At the manufacturer’s splash screen, press the key to get into the boot menu. This key varies across PCs, as an example for a Lenovo Thinkpad it is F12. Consult your user manual to find out what the key is or google. Do not confuse the boot menu with the boot priority order settings in BIOS. The boot menu is a one time selection for the device to use to boot the PC. It overrides the normal boot priority order. The next time you boot, the PC will revert to the normal boot order. Virtually all BIOSs support this feature, they just do it differently. </div> </div> <div class="down__column" style="background-color:#ddd;"> <div class="part__head">Get the "<?php echo "{$debname}";?>" file (approx. 7MB) </div><br> <a href="download/{$debname}";?>"><center><img src="images/download.png" style="height:44px; width:144px;" alt="download deb file"> </center></center></a> <br /> <div class="part__head">The MD5sum is: <?php echo "{$debmd5}";?> </div> <div class="down__redtext"><br>WARNING - FOR EXPERT USE ONLY !!!</div> <div class="down__text"><br>This .deb file is designed to be installed on a large USB drive, typically 1TB or greater, that already has an operating system installed and is intended as a backup drive.<b> For more information <a href="/download/deb_file.pdf" style="color:#ff0099">Click Here.</a></b></h3> </div> <hr> <div class="part__head">Get the "<?php echo "{$srcname}";?>" Source file (approx. 6MB) </div><br> <a href="download/{$srcname}";?>"><center><img src="images/download.png" style="height:44px; width:144px;" alt=""></center> </a> <br> <div class="part__head">The MD5sum is: <?php echo "{$srcmd5}";?> </div> <div class="down__text"><br />This contains the files used to build Foxclone itself. It is provided to meet the terms of the GNU General Public License.</div> </div> </div> </div> <?PHP require_once("footer.php"); ?>
I have two arrays, as follows: $array1 = (1, 2, 3); $array2 = (4, 5, 6); Is there a function to combine the two without having to do a loop? I'd like to create: $array3 = (1, 2, 3, 4, 5, 6); I'm using a upload class that works with $_FILES, but have a couple of reasons to need the content of php://input: 1) When submitting PDF forms as a complete form, the form is available in php://input. 2) An ajax uploader I'd like to use submits the file making it only available in php://input. I know I could use an if statement to check $_FILES else php://input, but I'm concerned about security, and being able to identify the filetype, get the size, etc. I'm skipping over some other details, because I need to leave in 5 minutes. I've not seen any classes that merge the two ( $_FILES and php://input ), and really haven't seen any that are specifically for php://input. Can anyone offer advice or point me in the right direction? I have a successful select query, where I'm looping and building a row for getting parameters which works correctly while ($row = $orderDetailCheck->fetch(PDO::FETCH_ASSOC)) {
$params = [ } My issue now is that, for each row, I need to perform two merges because the data from that select is going to be split into two tables in db2. Some values are truly split between the tables but some values are shared between the two. I'm not sure the best way to perform these two merges because if the first one (products table) inserts, then it creates an ID that I need as a foreign key basically, to insert into the orders table. So on insert I need to grab that newly created ID and use it for ```product_id``` in the second merge. If the first merge performs the update when matched, then I need to grab the existing ID for that record so that I can update the proper record in the orders table. My two merge statements:
/*products table*/
:GROUP,
)
AS S(GROUP,DTL12,DTL13,CUSTNM,SELLINGN,COUNT_PLMN_1,LAST_DATE)
WHEN MATCHED
WHEN NOT MATCHED
/*ORDERS Table*/
/*need foreign key, which is id from products table*/
AS S(PRODUCT_ID,quantity_ordered,LAST_DATE,invoice_number)
WHEN MATCHED
WHEN NOT MATCHED Examples:
INVOICE | CUSTNM | SELLINGNUM | GROUP | DTL12 | DTL13 | QUANTITY | COUNT_PLMN_1 | LAST_DATE
products
ID | GROUP | DTL12 | DTL13 | CUSTNM | SELLINGNUM | COUNT_PLMN_1 | LAST_DATE
ORDERS
PRODUCT_ID | QUANTITY_ORDERED | LAST_DATE | INVOICE
INVOICE | CUSTNM | SELLINGNUM | GROUP | DTL12 | DTL13 | QUANTITY | COUNT_PLMN_1 | LAST_DATE
products
ID | GROUP | DTL12 | DTL13 | CUSTNM | SELLINGNUM | COUNT_PLMN_1 | LAST_DATE and update orders like so: ORDERS
PRODUCT_ID | QUANTITY_ORDERED | LAST_DATE | INVOICE I guess the main question is: How can I get the ID of a record from the products table (whether it's an existing match OR newly created in the merge) and once I get it, how can I use it for the 2nd merge? So basically I have two lines that generate an image from png and then preserve the transparency of said png. Code: [Select] $bub1 = imagecreatefrompng ("Energy/$energy1b.png"); imageSaveAlpha($bub1, true);This works by itself when generating just this image. But when combined with another image: Code: [Select] imagecopymerge($image, $bub1, 680, 40, 0, 0, 50, 50, 100);It fills in the back ground around the image and the transparency is not preserved. Why is this and how can i fix it? |