Jump to content

JaredRitchey

Members
  • Posts

    15
  • Joined

  • Last visited

Everything posted by JaredRitchey

  1. I need to hire a programmer to help on a project and would like to narrow down a framework. My app needs to be Object Oriented, must use the PDO Library and work on MySQL initially. I'd like to follow the MVC development structure. Which framework would someone suggest I use?
  2. Can't do a search in the forum, says I dont have permission to search so I'll make a new post. I need a script to assist with debugging and speed testing my PHP code. I've looked at PHP Debug but it appears to be for PHP4 I looked at PIXY but also for PHP4 Any suggestions would be great, there are parts of my app that are painfully slow.
  3. I store the array in a database field but it will not return the array once called. Here is what works if I have the array set manually in the PHP File. // THIS WORKS //$cleanData=array("1","2","9","3"); // AND Apparently THIS WORKS Without Commas $cleanData=array(1,9,3,2); foreach($cleanData as $cleanExtract){ if($cleanExtract == 1){ echo "one <br />"; } elseif($cleanExtract == 2){ echo "two <br />"; } elseif($cleanExtract == 3){ echo "three <br />"; } } Brings back one three two This however Does Not Work! and I'm not sure why. // Standard DB connect stuff here, then; $result=mysql_query("SELECT * FROM extractor_settings WHERE id={$batch}"); $cleanData=array($row['cleanData']); foreach($cleanData as $cleanExtract){ if($cleanExtract == 1){ echo "one <br />"; } elseif($cleanExtract == 2){ echo "two <br />"; } elseif($cleanExtract == 3){ echo "three <br />"; } }
  4. so the include script would include others based on criteria? Should I store this criteria in the DB?
  5. Thorpe, what would you suggest? I need to be able to change the includes on a per project basis.
  6. I need to explain this a little so it makes sense. In my script I add my includes at the top of the file which are most often required_once as opposed to an include. There are situations where the names of the included files and the number varies depending on project. Currently I do something like; require_once('project/florida.php'); require_once('project/sdtv.php'); require_once('project/config.php'); What I would like to do is store those values or multiple values in the database such as (florida.php,sdtv.php,config.php) and then in the script I'd query the field to bring back the include. I tried to use an include all files in a folder where I first stored them in /project/ but it was nasty slow. Is there any reason to believe this is a good way of doing things?
  7. Okay, that makes sense now, thanks!
  8. Thanks sincerely, but will that work even though $dbname is a dynamic variable?
  9. I have a script that runs at the end of a batch process specifically built to clean out empty records. How can I make it a function and then call the function. Here is my query; $sql="DELETE FROM ".$dbname." . property WHERE property . id=''"; mysql_query($sql) or die("<b>A fatal MySQL error occured</b>.\n<br />Query: " . $sql . "<br />\nError: (" . mysql_errno() . ") " . mysql_error()); $sql="DELETE FROM ".$dbname." . agents WHERE agents . ip_source=''"; mysql_query($sql) or die("<b>A fatal MySQL error occured</b>.\n<br />Query: " . $sql . "<br />\nError: (" . mysql_errno() . ") " . mysql_error()); $sql="DELETE FROM ".$dbname." . settings WHERE settings . prop_id=''"; mysql_query($sql) or die("<b>A fatal MySQL error occured</b>.\n<br />Query: " . $sql . "<br />\nError: (" . mysql_errno() . ") " . mysql_error()); I would like this to be in a function that i could specifically call the function. Why? Well because I have 5 different sets of queries like this set above and I'm going to build a conditional. So like if condition 1 then run use this function, condition 2, use function ??? etc and so on.
  10. I realize I may have made that more complex than it needs to be. Here it is in simpler terms. If I do this; echo substr(date('c'), 0, 19); I can get back this; 2011-05-25T08:45:27 I want it to return this; 2011-05-25T10:45:27 Which simply adds two hours.
  11. I have a batch script that reads from a timestamp.txt file to determine the last time it ran and I need to modify that by two hours. What happens is the script will run to look for changes in the county records and their server time is two hours different from mine. $fr=fopen("xml/timestamp.txt",'r'); $mydate=fread($fr, 50); if ($incremental_updates == 1){ $default_template_file="xml/incremental_template.xml"; $default_config_name="xml/incremental.xml"; $contest=file_get_contents($default_template_file); $contest=str_replace("{DATE_TAG}", $mydate, $contest); $f=fopen($default_config_name,'w+'); fwrite($f, $contest); fclose($f); fclose($fr); $fw=fopen("xml/timestamp.txt",'w'); fwrite($fw, substr(date('c'), 0, 19)); fclose($fw); }else{ $default_config_name = "xml/full_update.xml"; } I tried making a time stamp update look like $cur_timestamp=date("Y-m-d H:i:s", time() +14400); which is correct but it doesn't write to the text file properly. Using the above fwrite($fw, substr(date('c'), 0, 19)); I get the correct results in the timestamp.txt file for my server time. I need it to be +14400 2011-05-25T08:27:51 would essentially become 2011-05-25T10:27:51 when it writes to the timestamp.txt I hope that makes sense. J
  12. Joomla and Virtuemart with some customization like LightBox are ideal together. I did a photography shop that sold stenos and lithos about 6 months ago using that combo. Joomla may be overkill though. ~ Jared
  13. Forgot to explain what its for. The idea is to have a sort of variable template engine of sorts where some pages would load the third column while others would always be two columns. Some however would load a third column with a pair of advertising blocks. Each of the column files are external and use an include statement in the actual template. If I use this it doesn't work case "/index.html" || $P == "/" || "$P" == "/index.php": If I use the following its fine case "/index.php": case "/index.htm": case "/index.html":
  14. I'm trying to get this chunk of code to work but I for some reason the code fails to respond correctly. What I'm after is the entire URI with or without file name to work properly as I comment here below. I'm almost certain its my syntax in the first line shown here. case "/index.html" || $P == "/" || "$P" == "/index.php": //I WANT THIS TO WORK //case "index.php": //ONLY THIS WORKS <?php $P=$_SERVER['REQUEST_URI']; switch ($P) { // Show Three columns with advertising block on right case "login.php"; case "privacy.php"; $data = 'threecolumn2.php'; break; // Show Three columns with NO advertising blocks case "/index.html" || $P == "/" || "$P" == "/index.php": //case "index.php": $data = 'threecolumn.php'; break; // TWO COLUMNS EVERY WHERE ELSE default: $data = 'twocolumn.php'; } ?> ~ Jared
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.