-
Posts
9,409 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MadTechie
-
for deleting see here unlink
-
[SOLVED] Extremely strange behaviour using FWRITE
MadTechie replied to neutra's topic in PHP Coding Help
its probably not being closed.. try this reboot the server. then try this script before another test. <?php $fp = fopen('thefile.txt', 'w'); fwrite($fp, 'Hello World'); fclose($fp); ?> -
usort is user-defined, but your still loss the keys (i think) if you wanted it to be user-defined then your need to use uasort but asort() is the one you want
-
Heres an update Note the change to the SQL statement "ORDER BY ProductType" <?php include('connect.php'); $getaccountinfo = mysql_query("SELECT * FROM Account"); $snagaccount = mysql_fetch_array($getaccountinfo); $AccountID = $snagaccount['AccountID']; $AccountName = $snagaccount['AccountName']; $AccountProductList = $snagaccount['AccountProductList']; ?> <html> <head> <title> Inventory </title> </head> <body> <div align=center> <br><br><br> <b>Account ID</b>: <?php echo($AccountID); ?> | <b>Account Name</b>: <?php echo($AccountName); ?> <br><br> <?php $getaccountlist = mysql_query("SELECT *.Products FROM Products, Account WHERE ID IN (Account.AccountProductList) ORDER BY ProductType"); echo " <table> <tr> <td align=center colspan=4> <b>Shirts</b> </td> </tr> <tr> <td> Product ID </td> <td> Product Name </td> <td> Product Type </td> <td> Product Price </td> </tr>"; $type = ""; while($row = mysql_fetch_array($getaccountlist)) { $UserProductID = $row['ProductID']; $UserProductName = $row['ProductName']; $UserProductType = $row['ProductType']; $UserProductPrice = $row['ProductPrice']; //this If create headers for each type if($type != $UserProductType) { echo "<tr><td colspan=\"4\">$UserProductType</td></tr>"; $type = $UserProductType; } echo " <tr> <td> ".$UserProductID." </td> <td> ".$UserProductName." </td> <td> ".$UserProductType." </td> <td> ".$UserProductPrice." </td> </tr>"; } echo "</table>"; ?> </div> </body> </html>
-
use asort() instead of sort()
-
from a quick scan i would guess $newname = $path . "http://www.eaglelegend.com/" . $user . "_" . $r . "." . $typer; should be $newname = $path . $user . "_" . $r . "." . $typer;
-
Sounds like a HTML/CSS problem, if i'm wrong can you explain a little clearer please
-
Cool, Now pleaseeeeeeeeeeeee click topic solved (that will make my day) PS: i have a few broken computers here, PC & Mac
-
it should be this $broad1name3="image/thumbs/thumb_".$image_name."?".$rand;
-
[SOLVED] Regex; Getting similar entries multiple times?
MadTechie replied to Dale_G's topic in Regex Help
try this <?php $fgc = file_get_contents('http://www.site.org/feed/btg.xml'); preg_match_all('/id="xhr_([0-9]+)"/si', $fgc, $cms, PREG_PATTERN_ORDER); $result = $cms[1]; echo "<pre>";print_r($result);echo "</pre>"; ?> -
lol beat me to it your welcome if your done, can you click solved please
-
Sorting strings both alphabetically and numerically
MadTechie replied to chris_p's topic in PHP Coding Help
thanks StormTheGates, i said that in the 2nd post anyway to be trueful it might be easier to pull them out into an array and sort them, i know why you have the problem but can't think how to solve it.. this is from the first record and its joins A1 A2 BK8 BK9 BK16 C3 the rest is from the next record and its joins, etc etc -
yes, providing its after the extension, which i think it is on your example
-
Okay well its a valid zip file, with the index of 2 files photo_1.jpg photo_2.jpg but its truncated (only has the first part of the file).. try this revised version <?php $str_filename=""; $str_filepath=""; $str_ext=""; $str_filename=trim($rs_download_file->fields("photosetfilename")); $str_filepath=trim($UPLOAD_ZIPFILE_PATH.$str_filename); header("Pragma: public"); header("Expires: 0"); // set expiration time header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Content-Type: application/force-download"); header("Content-Disposition: attachment; filename=".basename($str_filename)); header("Content-Transfer-Encoding: binary"); header("Content-Length: ".filesize($str_filepath)); readfile($str_filename); exit(); #$fp=fopen($str_filepath,'rb'); #fpassthru($fp); ?>
-
yes but theirs another problem, it will only return the first record change <?php $getaccountlist = mysql_query("SELECT *.Products FROM Products, Account WHERE ID IN (Account.AccountProductList)"); $row = mysql_fetch_array($getaccountlist); $ItemID = $row['ItemID']; $ItemName = $row['ItemName']; $ItemType = $row['ItemType']; $ItemPrice = $row['ItemPrice']; ?> to $getaccountlist = mysql_query("SELECT *.Products FROM Products, Account WHERE ID IN (Account.AccountProductList)"); echo "ItemID - ItemName - ItemType - ItemPrice"; while($row = mysql_fetch_array($getaccountlist) { $ItemID = $row['ItemID']; $ItemName = $row['ItemName']; $ItemType = $row['ItemType']; $ItemPrice = $row['ItemPrice']; echo "$ItemID - $ItemName - $ItemType - $ItemPrice"; ?> your need to build this into the html part a (mine is just basic) to check the correct data is being returned
-
the reason i hard coded it was because the database should return that (on this test), the fact the test worked proves the database isn't returning the correct data.. if the problem is purely a caching issule you can do this <?php $rand = time(); echo "<img src='myimage.jpg?$rand' >"; ?>
-
the use is on the main and the cart is on the addon correct? main passes the PHPSESSID to addon session_start(); $_SESSION['test'] = "Hello"; $PHPSESSID= session_id(); echo "addon.other.com/index.php?PHPSESSID=$PHPSESSID;" addon session_id($_GET['PHPSESSID']); session_start(); echo $_SESSION['test']; is that what your doing, becuase that should work..
-
try this, do updates (see comments) <?php $query = "SELECT broad1 FROM images_broad"; $result=mysql_query($query); while($row=mysql_fetch_array($result)) { $image_path=$row['broad1']; } //Add line beow $image_path= "thumbs/thumb_image161.jpg"; $path= 'http://www.acmeart.co.uk/mercury/image';//append the /image ?> now if that works, its a problem with the database (i don't have the db so i can't test that)
-
Sorting strings both alphabetically and numerically
MadTechie replied to chris_p's topic in PHP Coding Help
Humm without testing it myself its hard to say but try this $listing_sql = "select $select_column_list p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price, CASE WHEN ASCII(RIGHT(p.products_model, 1)) > 47 AND ASCII(RIGHT(p.products_model, 1)) < 58 THEN LPAD(CONCAT(p.products_model, '-'), 5, '0') ELSE LPAD(p.products_model, 5, '0') END AS `vsort` from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "' ORDER BY `vsort`";