PHP - Adding Info To .txt File From The Top?
Hi, I was wondering if this is possible as I've been tasked (uni project) with creating a blog site that displays entries in order of creation.
From what I've seen, when modifying the file I can only add entries from the bottom line and not from the top without replacing the previously stored content. Thank you. Similar Tutorialshello i am trying to add infomation into the mysql but it always seems to add it a 0 instead of what i am typeing into the form, the form is to add recipies to a users file. these are the scriprts, the fields that arnt showing up is prep and cook add_recipie.php <?php // Start_session, check if user is logged in or not, and connect to the database all in one included file include_once("scripts/checkuserlog.php"); // Include the class files for auto making links out of full URLs and for Time Ago date formatting include_once("wi_class_files/autoMakeLinks.php"); include_once ("wi_class_files/agoTimeFormat.php"); // Create the two objects before we can use them below in this script $activeLinkObject = new autoActiveLink; $myObject = new convertToAgo; ?> <?php // Include this script for random member display on home page include_once "scripts/homePage_randomMembers.php"; ?> <?php $sql_blabs = mysql_query("SELECT id, mem_id, the_blab, blab_date FROM blabbing ORDER BY blab_date DESC LIMIT 30"); $blabberDisplayList = ""; // Initialize the variable here while($row = mysql_fetch_array($sql_blabs)){ $blabid = $row["id"]; $uid = $row["mem_id"]; $the_blab = $row["the_blab"]; $notokinarray = array("fag", "gay", "shit", "fuck", "stupid", "idiot", "asshole", "cunt", "douche"); $okinarray = array("sorcerer", "grey", "shug", "farg", "smart", "awesome guy", "asshole", "cake", "dude"); $the_blab = str_replace($notokinarray, $okinarray, $the_blab); $the_blab = ($activeLinkObject -> makeActiveLink($the_blab)); $blab_date = $row["blab_date"]; $convertedTime = ($myObject -> convert_datetime($blab_date)); $whenBlab = ($myObject -> makeAgo($convertedTime)); //$blab_date = strftime("%b %d, %Y %I:%M:%S %p", strtotime($blab_date)); // Inner sql query $sql_mem_data = mysql_query("SELECT id, username, firstname, lastname FROM myMembers WHERE id='$uid' LIMIT 1"); while($row = mysql_fetch_array($sql_mem_data)){ $uid = $row["id"]; $username = $row["username"]; $firstname = $row["firstname"]; if ($firstname != "") {$username = $firstname; } // (I added usernames late in my system, this line is not needed for you) /////// Mechanism to Display Pic. See if they have uploaded a pic or not ////////////////////////// $ucheck_pic = "members/$uid/image01.jpg"; $udefault_pic = "members/0/image01.jpg"; if (file_exists($ucheck_pic)) { $blabber_pic = '<div style="overflow:hidden; width:40px; height:40px;"><img src="' . $ucheck_pic . '" width="40px" border="0" /></div>'; // forces picture to be 100px wide and no more } else { $blabber_pic = "<img src=\"$udefault_pic\" width=\"40px\" height=\"40px\" border=\"0\" />"; // forces default picture to be 100px wide and no more } $blabberDisplayList .= ' <table width="100%" align="center" cellpadding="4" bgcolor="#CCCCCC"> <tr> <td width="7%" bgcolor="#FFFFFF" valign="top"><a href="profile.php?id=' . $uid . '">' . $blabber_pic . '</a> </td> <td width="93%" bgcolor="#EFEFEF" style="line-height:1.5em;" valign="top"><span class="greenColor textsize10">' . $whenBlab . ' <a href="profile.php?id=' . $uid . '">' . $username . '</a> said: </span><br /> ' . $the_blab . '</td> </tr> </table>'; } } ?> <!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=ISO-8859-1" /> <meta name="Description" content="Web Intersect is a deft combination of powerful free open source software for social networking, mixed with insider guidance and tutorials as to how it is made at its core for maximum adaptability. The goal is to give you a free website system that has a network or community integrated into it to allow people to join and interact with your website when you have the need." /> <meta name="Keywords" content="web intersect, how to build community, build social network, how to build website, learn free online, php and mysql, internet crossroads, directory, friend, business, update, profile, connect, all, website, blog, social network, connecting people, youtube, myspace, facebook, twitter, dynamic, portal, community, technical, expert, professional, personal, find, school, build, join, combine, marketing, optimization, spider, search, engine, seo, script" /> <title>CookBookers</title> <link href="style/main.css" rel="stylesheet" type="text/css" /> <link rel="icon" href="favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" /> <script src="js/jquery-1.4.2.js" type="text/javascript"></script> <style type="text/css"> #Layer1 { height:210px; } body { background-color: #3c60a4; } .style4 {font-size: 36px} </style> </head> <body> <p> <?php include_once "header_template.php"; ?> </head> <body style="margin:0px;"> <center> </p> <p> </p> <table border="0" align="center" cellpadding="0" cellspacing="0" class="mainBodyTable"> <tr> <td width="124" valign="top"> <td width="776" colspan="2" align="left" valign="top" style="background-color:#EFEFEF; border:#999 0px; padding:10px;"> <table border="0" cellpadding="6"> </table> <table width="574" border="0"> <form method="POST" action="include/recipe.php"> <span class="style4">Add Recipie</span> <tr> <th width="232" scope="col"> </th> <th width="332" scope="col"> </th> </tr> <tr> <td><span style="margin-bottom:5px; color:brown;">Public:</span></td> <td><span style="margin-bottom:5px; color:brown;"> <input name="Pub" value="1" type="checkbox" id="Pub"/> </span></td> </tr> <tr> <td><span style="margin-bottom:5px; color:brown;">Title:</span></td> <td><span style="margin-bottom:5px; color:brown;"> <input type="text" name="title" /> </span></td> </tr> <tr> <td><span style="margin-bottom:5px; color:brown;">Prep time:</span></td> <td><span style="margin-bottom:5px; color:brown;"> <input name="prep" type="text" size="7" maxlength="10" /> </tr> <tr> <td><span style="margin-bottom:5px; color:brown;">Cooking time:</span></td> <td><span style="margin-bottom:5px; color:brown;"> <input name="cook" type="text" size="7" maxlength="10" /> </tr> <tr> <td><span style="margin-bottom:5px; color:brown;">Makes:</span></td> <td><span style="margin-bottom:5px; color:brown;"> <input type="text" name="make" /> </span></td> </tr> <tr> <td><span style="margin-bottom:5px; color:brown;">Ingrediants:</span></td> <td><span style="margin-bottom:5px; color:brown;"> <textarea rows="5" name="ingr" cols="40"></textarea> </span></td> </tr> <tr> <td><span style="margin-bottom:5px; color:brown;">Method: </span></td> <td><span style="margin-bottom:5px; color:brown;"> <textarea rows="5" name="desc" cols="40"></textarea> </span></td> </tr> <tr> <td><span style="margin-bottom:5px; color:brown;">Notes:</span></td> <td><span style="margin-bottom:5px; color:brown;"> <textarea rows="5" name="note" cols="40"></textarea> </span></td> </tr> <tr> <td><input name="submit" type="submit" style="padding:5px 10px;" value="Submit" /></td> </tr> </table> </tr> </table> </td> </tr> </table> <?php include_once "footer_template.php"; ?> </body> recipie.php <?php //include("session.php"); include("database.php"); @session_start(); $user = $_SESSION['username']; //die($user); $Pub=$_POST['Pub']; $title=$_POST['title']; $prep=$_POST['prep']; $cook=$_POST['cook']; $make=$_POST['make']; $ingr=$_POST['ingr']; $desc=$_POST['desc']; $note=$_POST['note']; //if($user=="Guest"||$user==""){ //header("Location: ../index.php"); //} //else{ $database->AddRecipe($user,$Pub,$title,$prep,$cook,$make,$ingr,$desc,$note); header("Location: ../recipe_added.php"); //} ?> database.php <? /** * Database.php * * The Database class is meant to simplify the task of accessing * information from the website's database. * * Written by: Jpmaster77 a.k.a. The Grandmaster of C++ (GMC) * Last Updated: August 17, 2004 */ include("constants.php"); class MySQLDB { var $connection; //The MySQL database connection var $num_active_users; //Number of active users viewing site var $num_active_guests; //Number of active guests viewing site var $num_members; //Number of signed-up users /* Note: call getNumMembers() to access $num_members! */ /* Class constructor */ function MySQLDB(){ /* Make connection to database */ $this->connection = mysql_connect(DB_SERVER, DB_USER, DB_PASS) or die(mysql_error()); mysql_select_db(DB_NAME, $this->connection) or die(mysql_error()); /** * Only query database to find out number of members * when getNumMembers() is called for the first time, * until then, default value set. */ $this->num_members = -1; if(TRACK_VISITORS){ /* Calculate number of users at site */ $this->calcNumActiveUsers(); /* Calculate number of guests at site */ $this->calcNumActiveGuests(); } } /** * confirmUserPass - Checks whether or not the given * username is in the database, if so it checks if the * given password is the same password in the database * for that user. If the user doesn't exist or if the * passwords don't match up, it returns an error code * (1 or 2). On success it returns 0. */ function confirmUserPass($username, $password){ /* Add slashes if necessary (for query) */ if(!get_magic_quotes_gpc()) { $username = addslashes($username); } /* Verify that user is in database */ $q = "SELECT password FROM ".TBL_USERS." WHERE username = '$username'"; $result = mysql_query($q, $this->connection); if(!$result || (mysql_numrows($result) < 1)){ return 1; //Indicates username failure } /* Retrieve password from result, strip slashes */ $dbarray = mysql_fetch_array($result); $dbarray['password'] = stripslashes($dbarray['password']); $password = stripslashes($password); /* Validate that password is correct */ if($password == $dbarray['password']){ return 0; //Success! Username and password confirmed } else{ return 2; //Indicates password failure } } /** * confirmUserID - Checks whether or not the given * username is in the database, if so it checks if the * given userid is the same userid in the database * for that user. If the user doesn't exist or if the * userids don't match up, it returns an error code * (1 or 2). On success it returns 0. */ function confirmUserID($username, $userid){ /* Add slashes if necessary (for query) */ if(!get_magic_quotes_gpc()) { $username = addslashes($username); } /* Verify that user is in database */ $q = "SELECT userid FROM ".TBL_USERS." WHERE username = '$username'"; $result = mysql_query($q, $this->connection); if(!$result || (mysql_numrows($result) < 1)){ return 1; //Indicates username failure } /* Retrieve userid from result, strip slashes */ $dbarray = mysql_fetch_array($result); $dbarray['userid'] = stripslashes($dbarray['userid']); $userid = stripslashes($userid); /* Validate that userid is correct */ if($userid == $dbarray['userid']){ return 0; //Success! Username and userid confirmed } else{ return 2; //Indicates userid invalid } } /** * usernameTaken - Returns true if the username has * been taken by another user, false otherwise. */ function usernameTaken($username){ if(!get_magic_quotes_gpc()){ $username = addslashes($username); } $q = "SELECT username FROM ".TBL_USERS." WHERE username = '$username'"; $result = mysql_query($q, $this->connection); return (mysql_numrows($result) > 0); } function showRecipees($username){ $q = "SELECT * FROM recipies WHERE user = '$username'"; $result = mysql_query($q, $this->connection); /* Error occurred, return given name by default */ if(!$result || (mysql_numrows($result) < 1)){ return NULL; } /* Return result array */ $rows; $i=0; while($row=mysql_fetch_row($result)) { $rows[$i]=$row; $i++; } return $rows; } function showRecipees1(){ $q = "SELECT * FROM recipies"; $result = mysql_query($q, $this->connection); /* Error occurred, return given name by default */ if(!$result || (mysql_numrows($result) < 1)){ return NULL; } /* Return result array */ $rows; $i=0; while($row=mysql_fetch_row($result)) { $rows[$i]=$row; $i++; } return $rows; } /** * usernameBanned - Returns true if the username has * been banned by the administrator. */ function usernameBanned($username){ if(!get_magic_quotes_gpc()){ $username = addslashes($username); } $q = "SELECT username FROM ".TBL_BANNED_USERS." WHERE username = '$username'"; $result = mysql_query($q, $this->connection); return (mysql_numrows($result) > 0); } /** * addNewUser - Inserts the given (username, password, email) * info into the database. Appropriate user level is set. * Returns true on success, false otherwise. */ function addNewUser($username, $password, $email){ $time = time(); /* If admin sign up, give admin user level */ if(strcasecmp($username, ADMIN_NAME) == 0){ $ulevel = ADMIN_LEVEL; }else{ $ulevel = USER_LEVEL; } $q = "INSERT INTO ".TBL_USERS." VALUES ('$username', '$password', '0', $ulevel, '$email', $time)"; return mysql_query($q, $this->connection); } /** * updateUserField - Updates a field, specified by the field * parameter, in the user's row of the database. */ function updateUserField($username, $field, $value){ $q = "UPDATE ".TBL_USERS." SET ".$field." = '$value' WHERE username = '$username'"; return mysql_query($q, $this->connection); } /** * getUserInfo - Returns the result array from a mysql * query asking for all information stored regarding * the given username. If query fails, NULL is returned. */ function getUserInfo($username){ $q = "SELECT * FROM ".TBL_USERS." WHERE username = '$username'"; $result = mysql_query($q, $this->connection); /* Error occurred, return given name by default */ if(!$result || (mysql_numrows($result) < 1)){ return NULL; } /* Return result array */ $dbarray = mysql_fetch_array($result); return $dbarray; } /** * getNumMembers - Returns the number of signed-up users * of the website, banned members not included. The first * time the function is called on page load, the database * is queried, on subsequent calls, the stored result * is returned. This is to improve efficiency, effectively * not querying the database when no call is made. */ function getNumMembers(){ if($this->num_members < 0){ $q = "SELECT * FROM ".TBL_USERS; $result = mysql_query($q, $this->connection); $this->num_members = mysql_numrows($result); } return $this->num_members; } /** * calcNumActiveUsers - Finds out how many active users * are viewing site and sets class variable accordingly. */ function calcNumActiveUsers(){ /* Calculate number of users at site */ $q = "SELECT * FROM ".TBL_ACTIVE_USERS; $result = mysql_query($q, $this->connection); $this->num_active_users = mysql_numrows($result); } /** * calcNumActiveGuests - Finds out how many active guests * are viewing site and sets class variable accordingly. */ function calcNumActiveGuests(){ /* Calculate number of guests at site */ $q = "SELECT * FROM ".TBL_ACTIVE_GUESTS; $result = mysql_query($q, $this->connection); $this->num_active_guests = mysql_numrows($result); } /** * addActiveUser - Updates username's last active timestamp * in the database, and also adds him to the table of * active users, or updates timestamp if already there. */ function addActiveUser($username, $time){ $q = "UPDATE ".TBL_USERS." SET timestamp = '$time' WHERE username = '$username'"; mysql_query($q, $this->connection); if(!TRACK_VISITORS) return; $q = "REPLACE INTO ".TBL_ACTIVE_USERS." VALUES ('$username', '$time')"; mysql_query($q, $this->connection); $this->calcNumActiveUsers(); } /* addActiveGuest - Adds guest to active guests table */ function addActiveGuest($ip, $time){ if(!TRACK_VISITORS) return; $q = "REPLACE INTO ".TBL_ACTIVE_GUESTS." VALUES ('$ip', '$time')"; mysql_query($q, $this->connection); $this->calcNumActiveGuests(); } /* These functions are self explanatory, no need for comments */ /* removeActiveUser */ function removeActiveUser($username){ if(!TRACK_VISITORS) return; $q = "DELETE FROM ".TBL_ACTIVE_USERS." WHERE username = '$username'"; mysql_query($q, $this->connection); $this->calcNumActiveUsers(); } /* removeActiveGuest */ function removeActiveGuest($ip){ if(!TRACK_VISITORS) return; $q = "DELETE FROM ".TBL_ACTIVE_GUESTS." WHERE ip = '$ip'"; mysql_query($q, $this->connection); $this->calcNumActiveGuests(); } /* removeInactiveUsers */ function removeInactiveUsers(){ if(!TRACK_VISITORS) return; $timeout = time()-USER_TIMEOUT*60; $q = "DELETE FROM ".TBL_ACTIVE_USERS." WHERE timestamp < $timeout"; mysql_query($q, $this->connection); $this->calcNumActiveUsers(); } /* removeInactiveGuests */ function removeInactiveGuests(){ if(!TRACK_VISITORS) return; $timeout = time()-GUEST_TIMEOUT*60; $q = "DELETE FROM ".TBL_ACTIVE_GUESTS." WHERE timestamp < $timeout"; mysql_query($q, $this->connection); $this->calcNumActiveGuests(); } function AddRecipe($user,$Pub,$title,$prep,$cook,$make,$ingr,$desc, $note){ if(!TRACK_VISITORS) return; $q = "INSERT INTO recipies (`user` ,`Pub` ,`title` ,`prep` ,`cook` ,`makes` ,`ingredients` ,`recipe` ,`notes`)VALUES ('$user', '$Pub', '$title', 'prep', 'cook','$make', '$ingr', '$desc', '$note');"; mysql_query($q, $this->connection) or die(mysql_error()); $this->calcNumActiveGuests(); } function recipie_comment($user,$comment,$recipie_id){ if(!TRACK_VISITORS) return; $q = "INSERT INTO recipie_comment (`user` ,`comment`, `recipie_id`);"; mysql_query($q, $this->connection) or die(mysql_error()); $this->calcNumActiveGuests(); } /** * query - Performs the given query on the database and * returns the result, which may be false, true or a * resource identifier. */ function query($query){ return mysql_query($query, $this->connection); } }; /* Create database connection */ $database = new MySQLDB; ?> and also the fields in the database are int 11 for both prep and cook thanks Hi Im having some trouble implementing info into a database Im trying to add some info to an existing cell in a mysql database. The cell currently reads: This is a piece of information. I would like to update the cell to read: This is a piece of information. a great piece of info. I have a variable with the following; $info = a great piece of info. Is it possible to add $info to the existing cell via php eg. <?php mysql_query("UPDATE mytable SET info = '$info' WHERE row = '$row'"); ?> all fine except I dont want to SET the info to $info I simply want to add $info onto the end of the existing data in the info record. Is this possible and how do i change the above query and go about it? Many thanks Hi Ive currently developed a script that connects via an API to send a message, and tested it with one user and it works perfectly. But now im bit stuck to send it to multiple users. All my visitors unique IDs are being stored into a file called unique.csv all in 1 column under each other. But what im currently trying to do is to recall the info from the csv and make a contact list to broadcast the message to.
The csv file looks like:
27823116700
m59317461002 I've created a function to update the database with the information from the text file...I've already got additional code (not posted here) that displays the orders that have NOT been shipped (and works beautifully). Then when they click the button it should process the text file and update the database (input the tracking number into the database) and change the order status and send an email to the customer, I know I've got something mixed up because it's not working... function process_shipping($ordernumber, $status=''){ $order_updated = false; $check_status_query = tep_db_query("select customers_name, customers_email_address, orders_status, date_purchased from " . TABLE_ORDERS . " where orders_id = '" . $ordernumber . "'"); $check_status = tep_db_fetch_array($check_status_query); $orders_statuses = array(); $orders_status_array = array(); $orders_status_query = tep_db_query("select orders_status_id, orders_status_name from " . TABLE_ORDERS_STATUS . " where language_id = 1"); while ($orders_status = tep_db_fetch_array($orders_status_query)) { $orders_statuses[] = array('id' => $orders_status['orders_status_id'], 'text' => $orders_status['orders_status_name']); $orders_status_array[$orders_status['orders_status_id']] = $orders_status['orders_status_name']; } if ($status!==''){ if ($check_status['orders_status'] !== $status) { tep_db_query("update " . TABLE_ORDERS . " set fedex_track_num = '" . $tracking . "'orders_status = '". $status . "', last_modified = now() where orders_id = '" . $oID . "'"); $customer_notified = '0'; $notify_comments = ''; $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]); tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, nl2br($email), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); $customer_notified = '1'; tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . (int)$oID . "', '" . tep_db_input($status) . "', now(), '" . tep_db_input($customer_notified) . "', '" . tep_db_input($comments) . "')"); $order_updated = true; } } } if ($_POST['update']=='1') { echo '<div class="dataTableContent" align="left">'; $arr=file("/home/onest4/public_html/beta/fedex.txt"); $x=1; foreach($arr as $str){ if (trim($str) != ''){ if ($x > 3){ list($tracking,$oID)=explode(" ",$str); if(ctype_digit($tracking)){ echo "Order# $oID, <b>$tracking</b> (DATABASE UPDATED)<br>"; } }else{ $x++; continue; } } } } hello dear PHP-experts have set up a server at localhost with phpMyAdmin i get back the site " it works " if i type in localhost i get access to the phpMyAdmin if i type localhost/phpMyAdmin so far so good now i wanted to go ahead: i ve uploaded a file called php_info.php to the htdocs folder. i changed permissions accordingly. (see below) linux-c5sz:/srv/www/htdocs # ls -l insgesamt 28 -rwxrwxrwx 1 root root 302 13. Mär 2006 favicon.ico drwxrwxrwx 2 root root 4096 6. Nov 2013 gif -rwxrwxrwx 1 root root 45 11. Jun 2007 index.html -rwxrwxrwx 1 root root 2356 28. Sep 2013 info2html.css -rwxrwxrwx 1 martin users 188 3. Dez 19:07 php_info.php drwxrwxrwx 6 root root 4096 3. Nov 17:40 phpMyAdmin -rwxrwxrwx 1 root root 26 13. Okt 15:32 robots.txt linux-c5sz:/srv/www/htdocs #what makes me wonder is - i cannot see the content of the file of php_info.php - why is this so see below <?php // Zeigt alle Informationen (Standardwert ist INFO_ALL) phpinfo(); // Zeigt nur die Modul-Informationen. // phpinfo(8) führt zum gleichen Ergebnis. phpinfo(INFO_MODULES); ?>well i wonder why i cannt see any information in thebrowser is this a bug ? Hi.. been a while since I have touched php and need some help. What I am trying to do is have my links pull text from separate php files, and load them into main table. Here is my old php code..used to work.. I had my index.php with my website template on it. In the table I want my info to appear i put this code. <?php /* START MAIN AREA HERE */ if($news) include("news.php"); elseif($bio) include("bio.php"); elseif($draw) include("draw.php"); elseif($pic) include("pic.php"); else include("news.php"); /* END HERE */?> My link looks like this. <A HREF="?news=x" ONMOUSEOVER="changeImages('home', 'images/home-over.gif'); return true;" ONMOUSEOUT="changeImages('home', 'images/home.gif'); return true;"> <IMG NAME="home" SRC="images/home.gif" WIDTH=69 HEIGHT=31 BORDER=0 ALT=""></A> Any help much appreciated! Okay, I'll make this short and sweet, and all side comments are irrelevant. I'm doing this for my own happies So using Facebook.com's API you can extract all of a specific user's friends in an array. Well I'm making a array check to see who on that users friend list was removed or deleted them that week using array_dif(); in this method: 1) User allows the application 2) Application catches the user's friends_id's in an array and stores them // this is where i'm having trouble, i'll come back to it 3) User then waits a few days and notices their friend count is no longer 400, it's now 399! 4) User logs into my application, and checks the previously uploaded array against their current array of friends. Okay now to the part i'm struggling with is, what would you do? Should i store them each uniquely in a database? Because some users have 4,000+ friends and that gets quite strenuous. OR! Should i save them into a txt file unique to that person's user_id. I kind of like the 2nd option, however it's less ( to my newbish mind ) customizable versus the sql_queries. Once again, i'd like to reiterate, i don't care that this is again Facebooks terms of service, it's for my own personal gain and just enjoy taking on projects in my spare time that force my brain to work hard. That's all, hope you excuse the typos and poor grammar. Typed this pretty quickly, any questions - feel free to ask! Hello,
Trying to rearrange a data on the website. Looks normal when looking through preview on IE and chrome. But once moved to live website, the whole alignment changes from left to center , including the text that needs to show up. I am a newbie to coding and dont have a clue. tried puttng something together based on what i foud on the web. attaching screenshot and the code that i did. any help is highly appreciated. also attached is a screenshot of what happens when the php file is uploaded. Prior to doing that, the menu on the left is aligned properly and the assets that we have show properly.
What we are trying to do is rearrage the whole assets into different categories.
many thanks
Attached Files
portfolio.php 3.27KB
2 downloads
noalignment.png 11KB
0 downloads Hi all i have stumbled across an issue and really need some help i have got a function below which i am using in a wordpress plugin. here is the code. // Base function function isd_s3player() { // Plugin Url $s3url = WP_PLUGIN_URL.'/'.str_replace(basename( __FILE__),"",plugin_basename(__FILE__)); echo '<object type="application/x-shockwave-flash" data="'.$s3url.'dewplayer-playlist.swf" width="235" height="200" id="dewplayer" name="dewplayer"> <param name="wmode" value="transparent" /> <param name="wmode" value="transparent" /> <param name="movie" value="'.$s3url.'dewplayer-playlist.swf" /> <param name="flashvars" value="showtime=true&autoreplay=true&xml='.$s3url.'playlist.php&autostart=1" /> </object>'; } ok the problem i am having is i cant passed the database variable to the playlist.php which the dewplayer needs to call within the function. is their a way to somehow use or set the playlist.php in this function without having to call it seperatly??? Here is my playlist.php <?php $bucket = get_option("isd-bucket"); $folder = get_option("isd-folder"); //include the S3 class if (!class_exists('S3'))require_once('s3/S3.php'); //AWS access info if (!defined('awsAccessKey')) define('awsAccessKey', 'amazon key'); if (!defined('awsSecretKey')) define('awsSecretKey', 'amazon secret key'); //instantiate the class $s3 = new S3(awsAccessKey, awsSecretKey); // Get the contents of our bucket $bucket_contents = $s3->getBucket($bucket,$folder); header("Content-type: text/xml"); $xml_output = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"; $xml_output .= '<playlist version="1" xmlns="http://xspf.org/ns/0/">\n'; $xml_output .= "<trackList>\n"; foreach ($bucket_contents as $file){ $fname = $file['name']; $furl = "http://$amazon_bucket.s3.amazonaws.com/".urlencode($fname); if(preg_match("/\.mp3$/i", $furl)) { if (isset($outputted[$furl])) { continue; } $xml_output .= "\t<track>\n"; $xml_output .= "\t\t<location>" . $furl . "</location>\n"; $xml_output .= "\t\t<creator>" . $fname . "</creator>\n"; $xml_output .= "\t\t<album>" . $fname . "</album>\n"; $xml_output .= "\t\t<title>" . basename($fname) . "</title>\n"; $xml_output .= "\t\t<annotation>I love this song</annotation>\n"; $xml_output .= "\t\t<duration>32000</duration>\n"; $xml_output .= "\t\t<image>covers/smetana.jpg</image>\n"; $xml_output .= "\t\t<info></info>\n"; $xml_output .= "\t\t<link>" . $furl . "</link>\n"; $xml_output .= "\t</track>\n"; $outputted[$furl] = true; } } $xml_output .= "</trackList>"; echo $xml_output; ?> ok so as you can see right at the top i am trying to grab two option from the database but it doesnt allow you to do it this way within wordpress. So i guess what i am asking is their a way to completely skip the playlist.php file and do everything within the function??? Any help?? hello. im trying to get the following to work. any ideas for me? Code: [Select] Text[12]=["Job Description","$description it "] it is in a .js file. Hi, Is it possible to add PHP code into a TPL file? Ive tried adding my code in as standard PHP and also tried it with the {php}.....{/php} tags but it still doesnt work. Any help appreciated! Thanks Tom Hi all, I am trying to add 3 images to a file on the server. The form is posted to a php page where I am trying to put the images in to a folder named aircraft. I have tried echoing the values and they are correct. But it is not working for some reason. Any help will be appreciated. The html form is: Code: [Select] <li> <label for="image">Main Image</label> <fieldset id="image1"> <input type="file" name="image" id="image" /> </fieldset> <label for="image2">Second Image</label> <fieldset id="image 2"> <input type="file" name="image2" id="image2" /> </fieldset> <label for="image3">Third Image</label> <fieldset id="image 3"> <input type="file" name="image3" id="image3" /> </fieldset> </li> The PHP page is: <?php $destination='aircraft/'.$reg."1.jpg"; $temp_file = $_FILES['image']['tmp_name']; move_uploaded_file($temp_file,$destination); $destination2='aircraft/'.$reg."2.jpg"; $temp_file2 = $_FILES['image2']['tmp_name']; move_uploaded_file($temp_file2,$destination2); $destination3='aircraft/'.$reg."3.jpg"; $temp_file3 = $_FILES['image3']['tmp_name']; move_uploaded_file($temp_file3,$destination3); ?> Hey anybody can please guide me where I m wrong in this php code please reply here is the code Only variables should be passed by reference on line 3 in that function area function get_file_extension($file_name) main error I guess is the explode one Aand yeah I checked adding $file_name = $_FILES['fld']; before the function is started <?php require("include/dbconn.php"); //$username = mysql_real_escape_string($_POST['username1']); function get_file_extension($file_name) { return end(explode('.',$file_name)); } function errors($error){ if (!empty($error)) { $i = 0; while ($i < count($error)){ $showError.= '<div class="msg-error">'.$error[$i].'</div>'; $i ++;} return $showError; }// close if empty errors } // close function if (isset($_POST['submit'])){ $username = "Sunny"; $date1 = date("d m y"); mysql_select_db("deals") or die(mysql_error()); if($username == "") { //header("location:newnewuser1.php"); echo "Username empty"; //header("location:newnewuser1.php"); } else { function createRandomPassword() { $chars = "abcdefghijkmnopqrstuvwxyz023456789"; srand((double)microtime()*1000000); $i = 0; $pass = '' ; while ($i <= 7) { $num = rand() % 33; $tmp = substr($chars, $num, 1); $pass = $pass . $tmp; $i++; } return $pass; } // Usage $password = createRandomPassword(); //$password = mysql_real_escape_string($_POST['Password']); $date = strtotime("+2hours"); $date1 = date("d-m-y",$date); if(get_file_extension($_FILES["fld"]["name"])!= 'csv') { $error[] = 'Only CSV files accepted!'; echo "Wrong Input"; }//get_file_extension if (!$error) { $tot = 0; $handle = fopen($_FILES["fld"]["tmp_name"], "r"); while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) { for ($c=0; $c < 1; $c++) { try { mysql_query("INSERT INTO newusers (email,password,location,company,name,contact,sourcename,date)VALUES('".mysql_real_escape_string($data[0])."','$password','".mysql_real_escape_string($data[1])."', '".mysql_real_escape_string($data[2])."','".mysql_real_escape_string($data[3])."','".mysql_real_escape_string($data[4])."','$username1','$date1')"); $tot++; } catch(Exception $e) { PRINT 'ERROR:' +$e; } }//for }//while fclose($handle); }// end no error }//close if isset upfile } ?> and this is the form code <form name="f1" action="" method="POST" enctype="multipart/form-data"> <table><tr><td><input type="file" value="Browse" name="fld" onselect="CheckExtension(fld)"><br/></td><td> </td></tr><tr><td>Username :<input type="text" name="username1" value="" id="user" onfocus="validateForm1()"></td> <td><input type="submit" name="submit" value="submit" id="submit"></td></tr></table> </form> Please help me I m stuck in this quite badly Please [attachment deleted by admin] I have a checkout form that goes like this... Code: [Select] <?php session_start(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head></head> <body></body> </html> Can I start adding this line of code to all of my PHP files - AS THE LAST LINE - without any negative consequences?? Code: [Select] <? // Build date 2011-05-14 ?> Debbie Hi all I have a string in an include file for a javascript lightbox value. I need this value to increase by one every time it loops. Here's my code: $fetchproducts = mysql_query(" SELECT * FROM `products` "); while($returnedProduct = mysql_fetch_array($fetchproducts)) { include('product-cell.php'); } The string is called $lightboxcount in the product-cell.php file Can I fit a ++ into the code above? Many thanks for your help Pete I have a script that will download a file from my server onto the user's computer. The problem is it's adding the pages HTML to the top of the file. When I actually look at the file on my server it does NOT have the HTML there, so it has to be some sort of problem with my headers. Code: [Select] <?php $fname = "keyword_files/".$this->fileID.".csv"; header('Content-type: application/csv'); header("Content-Disposition: inline; filename=".$fname); readfile($fname); ?> I would appreciate any help! Thanks. Hello, I am making an upload script and I want to restrict all file types except png, jpg, and gif. I can't seem to figure it out and help would be appreciated!! <?php $target = "images/"; $target = $target . basename( $_FILES['uploaded']['name']) ; $ok=1; //This is our size condition if ($uploaded_size > 230000) { echo "Your file is too large.<br>"; $ok=0; } if (!($uploaded_type=="image/gif")) { echo "You may only upload GIF files.<br>"; $ok=0; } //Here we check that $ok was not set to 0 by an error if ($ok==0) { Echo "Sorry your file was not uploaded"; } //If everything is ok we try to upload it else { if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded"; } else { echo "Sorry, there was a problem uploading your file."; } } ?> Hi, I am using Mouseflow analytics in a phpbb forum. In my specific application, I need to add their application's javascript code inside php code. How do I properly add Javascript code inside a php code. Thanks This is how I would add it to an html file <script type="text/javascript"> var _mfq = _mfq || []; (function () { var mf = document.createElement("script"); mf.type = "text/javascript"; mf.async = true; mf.src = "//cdn.mouseflow.com/projects/b22343cd9-0049-4443-8326-954444462d6515.js"; document.getElementsByTagName("head")[0].appendChild(mf); })(); </script> Im not much of a coder, and I obviously did this wrong since it is not working. Im trying to bring a new field value in to an existing php file. I created a new table, and an admin page to control that field. I cant, however, figure out how to use that value in a different php file. Actually, there are 2 files. Each using a different field from that new table. I will post what my current code is below with the additions I tried to add. I bolded the lines that contain the tags Im trying to use. Any and help you can give in fixing this to make it work is greatly appreciated. Code: [Select] <?php # INCLUDE ALL NECESSARY FILES. include_once("Constants.php"); include_once("Database.php"); include_once("SiteSetting.php"); [b]$query = "SELECT arcade_multiplier FROM tbl_point_rewards"; mysql_query($query) or die("Invalid query". mysql_error() ); $result = mysql_fetch_array($result); $arcade_multiplier = $result["arcade_multiplier"];[/b] $dbObj = new database(); # SAVE ARCADE GAME POINTS INTO THE DATABASE function saveGamePoints( $game_id, $user_id, $game_score, $calculate_score_flag, $play_date ){ global $dbObj; $user_max_plays = getUserMaxPlaysLimit( $user_id, $game_id ); //$_SESSION["arcade_game"]["save_score"] = ($user_max_plays < $_SESSION["arcade_game"]["max_plays"]) ? "yes" : "no" ; if($user_max_plays < $_SESSION["arcade_game"][$_SESSION["url_gameid"]]["max_plays"]){ $total_points = calculatePointRatio($game_id, $game_score); //$total_points = $game_score; $x_gameid = md5($game_id); if($_SESSION["arcade_game"][$x_gameid]["play_time"] > 0){ $playTime['start'] = $_SESSION["arcade_game"][$x_gameid]["play_time"]; $playTime['end'] = time(); $playTime = ($playTime['end'] - $playTime['start']); } else { $playTime = 0; } # update total points into main score [b] $update_sql = "update tbl_users set points_gained = (points_gained+(".ceil($total_points)." * $arcade_multiplier)) where usrid={$user_id}";[/b] $rs = mysql_query($update_sql) or die("Invalid query: {$update_sql} - ". mysql_error()); $table = "tbl_arcade_game_score"; $fields = array("game_id", "user_id", "game_score", "calculate_score_flag", "play_date", "game_time"); $values = array($game_id, $user_id, $game_score, $calculate_score_flag, $play_date, $playTime); // return $dbObj->cgi( $table, $fields, $values, 1 ); $insertid = $dbObj->cgi( $table, $fields, $values, "" ); $ceiling_point = getCeiling($game_id); if($game_score >= $ceiling_point) { $chk_authourity = isAlreadyTrophyOwner($user_id, $game_id); //if($chk_authority < 1) if($chk_authourity < 1) { # store award details into the database (tbl_trophy_award) //$trophy_id = getTrophy( $game_id ); $trophy = getTrophyDetails($game_id); $trophy_id = $trophy['ctoon_id']; $tbl_fields = array('userid', 'game_id', 'award_date', 'trophy' ); $tbl_values = array($user_id, $game_id, $play_date, $trophy_id ); $insert_tbl_trophy_award_id = $dbObj->cgi('tbl_trophy_award', $tbl_fields, $tbl_values , "" ); # award trophy to user (tbl_users_ctoons) $table = "tbl_users_ctoons"; $fl = array("usrid", "ctoon_id", "del_status", "ctoons_auction", "auction_id", "location", "batpts"); $vl = array($user_id, $trophy_id, '0', '', 0, 1, 0); $dbObj->cgi($table, $fl, $vl , "" ); # send a pm to the user about the trophy include_once("send_pm_message.php"); $game = getGameDetails($game_id); $msgSub = "Grats! You just got a trophy!"; $message = "Grats! You got the ".$trophy["toon_name"]." trophy for the ".$game["game_name"]." game!<br> <img src=\"{$game['path']}\">"; //echo $message; //echo "<br><hr><br>"; sendMessage($user_id, 0, 0, $msgSub, $message, 1); sendMessage(2034, $user_id, 0, $msgSub, $message, 1); } } return $insertid; } }//end function function getCeiling($game_id) { $sql = "SELECT ceiling FROM tbl_game WHERE game_id = '".$game_id."'"; $rs = mysql_query($sql); $result = mysql_fetch_assoc($rs); return $result['ceiling']; } function isAlreadyTrophyOwner($user_id, $game_id) { $sql = "SELECT * FROM tbl_trophy_award WHERE game_id = {$game_id} and userid = {$user_id}"; $rs = mysql_query($sql); $num_rows = 0; $num_rows = mysql_num_rows($rs); if($num_rows > 0) { return $num_rows; } else { return $num_rows; } } # calculate game ratio function calculatePointRatio($game_id, $game_score){ //return $game_score; $sql = "select gs.* from arcade_game_setting as gs where gs.game_id={$game_id}"; $rs = mysql_query($sql) or die( "Invalid query". mysql_error() ); if($rs){ $row = mysql_fetch_array($rs); switch($row["calculation_type"]){ case "divide": $x_score = round($game_score / $row["r_no"]); break; case "multiply": $x_score = round($game_score * $row["r_no"]); break; default : $x_score = ceil($game_score); break; }//switch $row["r_no"]; if($row["game_cap"] > 0){ if($x_score > $row["game_cap"]){ $x_score = $row["game_cap"]; } } return $x_score; }//if }// end function # get user total plays function getUserMaxPlaysLimit($user_id, $game_id){ global $d_start_time, $d_end_time; $sql = "select * from tbl_arcade_game_score where user_id={$user_id} and game_id={$game_id} and play_date between {$d_start_time} and {$d_end_time}"; $rs = mysql_query($sql) or die("Invalid query :". mysql_error() ); if($rs){ return mysql_num_rows($rs); }//if } # get game details function getGameDetails($game_id){ $sql = "select g.game_id, g.game_name, g.award_ctoonid, c.toon_name, c.toon_cat, c.toon_subcat, c.toon_small_img from tbl_game as g, tbl_ctoon as c where g.game_id = {$game_id} and g.award_ctoonid=c.ctoon_id"; $rs = mysql_query($sql); if($rs){ $row = mysql_fetch_array($rs); if($row['toon_cat']!="" && $row['toon_subcat']!=0) $tpth="imgtoon/".$row['toon_cat']."/".$row['toon_subcat']."/thumb"; elseif($row['toon_cat']!="" && $row['toon_subcat']==0) $tpth="imgtoon/".$row['toon_cat']."/thumb"; $game["game_name"] = $row["game_name"]; $game["award_ctoon_id"] = $row["award_ctoonid"]; $game["toon_name"] = $row["toon_name"]; $game["path"] = SITEROOT ."/" . $tpth ."/" . $row["toon_small_img"]; return $game; } else { return false; } } # send pm message to winner function sendPMToWinner($user_id, $game_id, $game_score){ include_once("send_pm_message.php"); $g = $game_id; //$point_prize = calculatePointRatio($game_id, $game_score); $point_prize = $game_score; $game = getGameDetails($game_id); //# select ctoon //$sql = "select award_ctoonid from tbl_game where game_id=".$g; //$rsctoon = mysql_query($sql) or die("Invalid query: {$sql} - ". mysql_error()); //$row_ctoon = mysql_fetch_array($rsctoon); //$ctoon_id = $row_ctoon["award_ctoonid"]; //# award ctoon //$insert_user_ctoon = "insert into tbl_users_ctoons (usrid, ctoon_id, del_status, ctoons_auction, auction_id, location, batpts) //values('{$user_id}', '{$ctoon_id}', '0', '', '', '1', '0')"; //mysql_query($insert_user_ctoon) or die("Invalid insert query:".mysql_error() ); //# update points $update_points_sql = "update tbl_users set points_gained = (points_gained+1500) where usrid={$user_id}"; mysql_query($update_points_sql) or die("Invalid updates points query". mysql_error() ); $dbObj = new database(); $msgSub = "Grats! You got a Top Score for ".$game["game_name"]." !"; $message = "Grats! You had one of the Top 10 scores in the ".$game["game_name"]." game last month, and got a 1500 point bonus!<br>"; //<img src=\"{$game['path']}\">"; // echo $message; // echo "<br><hr><br>"; sendMessage($user_id, 0, 0, $msgSub, $message, 1); } /** * function getTrophy( $game_id ) * @param $game_id */ function getTrophy( $game_id ){ $sql = "select award_ctoonid from tbl_game where game_id=".$game_id; $rs = mysql_query( $sql ) or die( mysql_error() ); if( $rs ){ $row = mysql_fetch_assoc( $rs ); } return $row["award_ctoonid"]; } // Updated function from above // Will get more information about the trophy function getTrophyDetails($game_id) { $sql = "select b.ctoon_id,b.toon_name,b.toon_small_img from tbl_game as a,tbl_ctoon as b where a.game_id = '$game_id' and b.ctoon_id = a.award_ctoonid LIMIT 1"; $rs = mysql_query( $sql ) or die( mysql_error() ); if( $rs ){ $row = mysql_fetch_assoc( $rs ); } return $row; } ?> Code: [Select] <?php include_once("Constants.php"); include_once("Database.php"); include_once("SiteSetting.php"); /**************************************************/ # SAVE DONETION IN DATABASE # @param $uid # @param $donation_amt /**************************************************/ function saveDonetion($uid, $donation_amt, $transaction_id, $subscr_id='', $type){ if($transaction_id != "") { $flag = checkExist($uid); if($flag > 0){ updateDonetion($uid, $donation_amt, $transaction_id, $subscr_id='', $type); }else{ addDonetion($uid, $donation_amt, $transaction_id, $subscr_id='', $type); } } } /**************************************************/ /**************************************************/ # CHECK IS RECORD EXITS IN DONETION TABLE # @param $uid /**************************************************/ function checkExist($uid){ $dbObj = new database(); $sql = "select user_id from tbl_donation where user_id={$uid}"; $dbObj->myquery($sql); if($dbObj->row_count > 0){ return $dbObj->f_user_id; }else{ return 0; } } /**************************************************/ /**************************************************/ # INSERT DONETION RECORD IN tbl_donation # @param $uid # @param $donation_amt /**************************************************/ [b]$query = "SELECT arcade_multiplier FROM tbl_point_rewards"; mysql_query($query) or die("Invalid query". mysql_error() ); $result = mysql_fetch_array($result); $arcade_multiplier = $result["arcade_multiplier"];[/b] function addDonetion($uid, $donation_amt, $transaction_id, $subscr_id='', $type){ $dbObj = new database(); $months = floor($donation_amt / 5); $exp_time = mktime(date("H"),date("i"),date("s"),date("m") + $months,date("d"),date("Y")); $fields = array("transaction_id", "subscr_id", "user_id", "donation_amt", "donation_date", "exp_date", "donation_type", "transaction_details"); $values = array($transaction_id, $subscr_id, $uid, $donation_amt, time(), $exp_time, $type, serialize($_SESSION["recurring_td"])); # update points [b]$update_points_sql = "update tbl_users set points_gained = (points_gained+(($donation_amt / 5) * $donation_pts)) where usrid={$uid}";/[b] mysql_query($update_points_sql) or die("Invalid updates points query". mysql_error() ); if($donation_amt < 5){ // The user donated less than $5 }else{ upgradeAccount($uid); } return $dbObj->cgi("tbl_donation", $fields, $values, false); } /**************************************************/ /**************************************************/ # UPDATE EXISTING DONETION RECORD # @param $uid # @param $donation_amt /**************************************************/ function updateDonetion($uid, $donation_amt, $transaction_id, $subscr_id='', $type){ if(strlen($subscr_id) > 0){ $cd = " AND subscr_id='".$subscr_id."'"; } $sql_select = "select exp_date, donation_amt from tbl_donation where user_id=".$uid; //$sql_select = "select exp_date, donation_amt from tbl_donation where user_id=".$uid." and donation_type like '%recurring%'"; $rs_select = mysql_query($sql_select) or die("Invalid query".mysql_error()); if($rs_select){ $row = mysql_fetch_array($rs_select); $expdt = $row["exp_date"]; $damt = ($row["donation_amt"] + $donation_amt); $months = floor($donation_amt / 5); $exp_time = mktime(23, 59, 59, date("m",$row["exp_date"]) + $months, date("d", $row["exp_date"]), date("Y", $row["exp_date"])); } $dbObj = new database(); $sql = "update tbl_donation set transaction_id='".$transaction_id."', donation_amt=(donation_amt + {$donation_amt}), donation_date = ".time().", exp_date=".$exp_time.", donation_type='".$type."', transaction_details='".serialize($_SESSION["recurring_td"])."' where user_id={$uid}"; # update points [b]$update_points_sql = "update tbl_users set points_gained = (points_gained+(($donation_amt / 5) * $donation_pts)) where usrid={$uid}";[/b] mysql_query($update_points_sql) or die("Invalid updates points query". mysql_error() ); $dbObj->myquery($sql, 1); if($donation_amt < 5){ // The user donated less than $5 }else{ upgradeAccount($uid); } } /**************************************************/ /**************************************************/ # UPDATE EXISTING RECURRING DONETION RECORD # @param $uid # @param $donation_amt /**************************************************/ function updateRecurringDonetion($subscr_id, $transaction_amt){ $sql_subscr = "select donation_id, transaction_id, user_id from tbl_donation where subscr_id = '".$subscr_id."'"; $rs_subscr = mysql_query($sql_subscr) or die("Invalid query".mysql_error()); if(strlen($rs_subscr) > 0){ $row_subscr = mysql_fetch_assoc($rs_subscr); $uid = $row_subscr["user_id"]; $donation_amt = $transaction_amt; $transaction_id = $row_subscr["transaction_id"]; $subscr_id = $subscr_id; $type = "Recurring"; updateDonetion($uid, $donation_amt, $transaction_id, $subscr_id='', $type); } } /**************************************************/ /**************************************************/ # UPDATE USER STATUS FROM STANDERED TO PREMIUM # @param $uid /**************************************************/ function upgradeAccount($uid){ $dbObj = new database(); $sql = "UPDATE tbl_users SET acc_type = 'P' WHERE usrid={$uid} LIMIT 1 "; # update points $update_points_sql = "update tbl_users set points_gained = (points_gained+0) where usrid={$uid}"; mysql_query($update_points_sql) or die("Invalid updates points query". mysql_error() ); $dbObj->myquery($sql, 1); }//function upgradeDonation($uid) ?> |