Jump to content

will35010

Members
  • Posts

    276
  • Joined

  • Last visited

Everything posted by will35010

  1. Yeah, they are in the db, but I'm building this app with laravel 4. I'm using the query builder and eloquent so I'm trying to do it in the code to avoid complicating the query since I'm new to the framework.
  2. That worked! It was about to drive me insane...lol. Thank you Ch0cu3r!
  3. I'm afraid that returns the same thing $start = "2014-05-22 09:16:24"; $type = 30; $endtime = date('Y-m-d H:i:s',strtotime($start, "+$type minutes")); echo "End: ".$endtime."</br>Start: ".$start; End: 2014-05-22 09:16:24 Start: 2014-05-22 09:16:24
  4. Hello, I'm trying to use strtotime to add time to a mysql type timestamp. Any help would be appreciated. I think I have tunnel vision from looking at it when I know it has to be something obvious...lol $start = "2014-05-22 09:16:24"; $type = 30; $endtime = date($start,strtotime("+ '.$type.' minutes")); echo "End: ".$endtime."</br>Start: ".$start; Right now it returns: End: 2014-05-22 09:16:24 Start: 2014-05-22 09:16:24
  5. This is a php forum. I would look at http://sucuri.net/ and scan your site using their free malware scanner.
  6. Thank you for pointing me in the right direction. It was the way the function was returning the result. Thank you again!
  7. Hello, I think I've been staring at this too long and now cannot see it straight anymore so another pair of eyes would be greatly appreciated. I have the below code that pulls a result from mysql and puts it into an array. I now need to run a function from my class on one of the items in the array since I am using smarty to template and cannot call the function from the template or shouldn't anyway. <?php ini_set('display_errors', 1); error_reporting(E_ALL); include ('classes/TrackingBoardClass.php'); include ('functions.inc.php'); $clientID = "1"; $TrackingClass = new TrackingBoardClass(); $results = $TrackingClass->GetBoardResults($clientID); if ($results != "") { while ($row2 = mysqli_fetch_assoc($results)) { $boardresults[] = $row2['priorityID']; } } //print_r($boardresults); foreach ($boardresults as $value) { echo $TrackingClass->GetPriority($clientID, $value)."<br>"; } ?> The $TrackingClass->GetPriority is the function that I am trying to run on the results, but I get error: Object of class mysqli_result could not be converted to string. Any help or insights would be greatly appreciated. Thank you!
  8. Hi, This page actually has the commands for apt based systems: http://code.google.com/p/tesseract-ocr/wiki/Compiling
  9. Hi, http://code.google.com/p/tesseract-ocr/wiki/ReadMe would be a good place to start.
  10. The big thing with SSD is getting a lower disk TPS rate. I personally like to setup Apache to run on port 8080 and Nginx to run on port 80 to act as a reverse proxy to lighten the load on Apache. I also setup and tune php apc. This setup has allowed me to run some high traffic sites on really low cost boxes.
  11. You could also output it to a pdf so you wouldn't have to worry about the browser differences.
  12. Do you get an error when running your php code from php? If not, there isn't a lot that folks here will be able to do. You are better off asking for help in a forum that is specific for your IDE if it's an IDE issue.
  13. Hello, Have you checked your upload size in your php.ini? upload_max_filesize = 10M post_max_size = 10M
  14. Although each join specification joins only two tables, FROM clauses can contain multiple join specifications. This allows many tables to be joined for a single query.
  15. This really isn't db problem but I see you moved the thread. This problems relates to setting the db name using a session variable. I'll just use one db and use clientID's to separate the data since this doesn't seem to be easily accomplished. I know I can set a clientID for a query since I've done that in the past. Thanks for your help.
  16. <?php session_start(); $_SESSION['clientid'] = "clientA"; $clientid = $_SESSION['clientid']; $db_name="db_".$clientid; //Just my coding style, you could also do $db_name="db_$clientid"; If you're okay with a hybrid variable and string inside the same quotes. $db = mysqli_connect('localhost', 'fake_user', 'my_password', $db_name); $sql = mysqli_query($db, "SELECT * FROM test"); ?> If I'm not mistaken, they way you had it you would open two MySQL connections, but you'd only ever be using one of them. Major waste of server resources; and if you add more clients, it would just be a nightmare, and possibly a MySQL server crash, due to overload. Thank you for your reply. I always put my db info in a file and include it where needed and close the connection after use. I don't see how to make your solution work in the way I need. The site will be too big to have the db connect info on each page and would be a nightmare to change when the db needs to be moved.
  17. I really don't want to put the connect function on each page so I usually create a db.php and just include the file. It there a way to do it with the connection variable on mysqli instead. For example, client A: include('db.php'); mysqli_query($clientA, "SELECT * FROM test;"); ClientB include('db.php'); mysqli_query($clientB, "SELECT * FROM test;"); Is there a way to set the $conn name based on session data?
  18. I am working on an application and I wanted it to be a single app with a database for each client. What is the best way to do this? I've tried setting the DB connection using a variable, but it doesn't work. Example: <?php session_start(); $_SESSION['clientid'] = "clientA"; $db = $_SESSION['clientid']; $clientA = @mysqli_connect('localhost', 'fake_user', 'my_password', 'db_clientA'); $clientB = @mysqli_connect('localhost', 'fake_user', 'my_password', 'db_clientB'); $sql = mysqli_query($db, "SELECT * FROM test;"; ?>
  19. I got it working with this: $i = 1; while($row = odbc_fetch_array($execute, $i)){ $pat_num = odbc_result($execute, "adpat"); echo $pat_num; $pat_nam = odbc_result($execute, "adptnm"); echo $pat_nam."</br>"; $i++; } AS400 DB2 is no fun compared to mysql.
  20. I have it returning the results with this: $sql = "SELECT adpat, adptnm, addate, adtime, adddsc, disdt, distm, drname, adptyp, ptprvtyp FROM hma711.zadpatnmf JOIN hma711.addocrmf on adamdr = drno WHERE addate BETWEEN '20111115' AND '20111115' AND adpat BETWEEN '2000000' AND '2999999'"; $execute = odbc_exec($conn, $sql); $count = odbc_num_rows($execute); echo $count."</br>"; $i = 1; while($i<=$count) { $pat_num = odbc_result($execute, "adpat"); echo $pat_num; $pat_nam = odbc_result($execute, "adptnm"); echo $pat_nam."</br>"; $i++; } But it repeatedly echos on the first row of data for all records returned.
  21. I tried this without any luck for($i=1;$row=odbc_fetch_row($execute,$i);$i++) { echo $row[0]; }
  22. It returns false like it isn't set. bool(false)
  23. I have this code: $sql = "SELECT adpat, adptnm, addate, adtime, adddsc, disdt, distm, drname, adptyp, ptprvtyp FROM hma711.zadpatnmf JOIN hma711.addocrmf on adamdr = drno WHERE addate BETWEEN '20111115' AND '20111115' AND adpat BETWEEN '2000000' AND '2999999'"; $execute = odbc_exec($conn, $sql); $num = odbc_num_rows($execute); echo $num; while($row = odbc_fetch_array($execute)){ echo $row['adpat']; } It gets an error on this line: echo $row['adpat']; The error is Notice: Undefined index: adpat in C:\xampp\htdocs\erboard\test.php on line 29 The query works directly on the AS400 I'm pulling from and the $num is being populated with the correct number of records. This is the first time I have ever used php with odbc so I'm not sure what I'm missing. Any help would be greatly appreciated. Thanks!
  24. I have never used CURL inside of PHP, but it looks like it's having a problem with the variable $ch. Sorry that isn't much help.
×
×
  • 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.