Jump to content

QuickOldCar

Staff Alumni
  • Posts

    2,972
  • Joined

  • Last visited

  • Days Won

    28

Everything posted by QuickOldCar

  1. It would be better to include the script do checks on the data display data if meets what you expected
  2. Don't want to hijack the OP's thread or anything, sorry OP. I agree with what you say kicken. As for my needs... My search index uses fulltext myisiam using mysql on a windows manual built amp stack.(not wamp or anything similar, they always crashed under loads) The system uses the search terms as dynamic queries to organize the data, not the data being placed into tags or categories. It's indexed properly and the only way can do so many at this time. I've tried and experimented quite a few ways how to go about it over the years, the current way was the only way that could even work with so many records. It basically runs on 2 intel quad core servers, one for website, the other for crawlers,indexers and snaps images. Have an additional 5 other servers to turn up the juice a bit, but is a home network so keep it at most to like 10 instances at a time. I actually made it modular to do multiple servers and multiple instances for expansion, the bottleneck will always be mysql though. I've considered exporting all the data into a more relationship category system just for display purposes but that will lose all the advanced search functionality it currently has. I assumed would never be a good idea to have every single possible word maybe even combinations of words as a category anyway. Actually I have plans in the future to turn it all into an api which will do background queries as json and save them versus my current html cache system. It's been my personal project anyway I so happen to share, was never in a hurry with it.
  3. I'm sure people do it both ways. Is more than just a performance aspect here though. My opinion is anyone doing large amounts of data should not hold it all in one table or have extremely large indexes. Anyone doing big data or real-time data should look into NoSQL I suggest cassandra Everyone's needs are not always similar. I'll just tell you my experiences. As in my cases the only feasable backup solutions would be mirroring drives or a node replication system... or stopping everything and painfully wait for all the mysql data files to copy to another drive. I've ran into corruption issues quite a few times due to power outages with sql. The larger tables are not always repairable. The risk of losing all the data is not worth it. If you are talking anywhere under a million records, yes with proper indexing is entirely possible to get reasonable fast results a single table. Once you start going higher will start seeing the performance degrade and totally reliant on caching. If the application has constant inserts or table locking, you will see it even slower and have to wait for other processes to complete. I actually do my search single tables with 5 million sites and over a billion for links. If was a better solution 7 years ago I would have used it. It's near impossible to query the larger links table other than a normal query pulling by just an id or a set of them. I was forced to use sphinx which always has to reindex and does not index all results or in the same way mysql could fetch them. Another instance of mine was a high traffic, big data feed aggregator doing articles upon thousands of websites. It was always inserting new data which affected the fetching and display. Again had to rely heavily on caching which sucks if want to keep showing the more recent data, so a lot gets passed by. I also have a few api systems that partly uses my own simple files and indexing system versus all sql because of the above issues. I'll surely migrate that all to cassandra.
  4. Isn't this the same issue as this post? http://forums.phpfreaks.com/topic/292820-connecting-to-database-and-displaying-the-row/
  5. To elaborate what Barand said...do a mysql query and echo any results from it
  6. I'm sure is a few programs out there that can make that if look for them. You can go very basic and draw the images any image editor you desire,then use windows movie maker or something like animation shop. A little better would be to use Blender , always free and can find plenty of tutorials. If wanted more professional and advanced animations. Usually takes a combination of programs to get a nice completed project. Most programs take a serious learning curve, costly, very time consuming and not for everyone. Even if learn them doesn't mean can create something nice with it. They are tools just like a hammer to a cabinetmaker, not everyone can make nice furniture given the same tools. I'm a photoshop,3dsmax, autocad person, with those can make a lot mudbox and zbrush can be great additions some items of interest Free: Pencil Synfig Studio PowToon Inkscape Tupi Scratch Gmax Blender DAZ 3d K-3D Art of Illusion Zmodeler TopMod Google SketchUp 8 AutoQ3D Anim8or Seamless3d BRL-CAD Serif (is a pile tools they offer free) 3D Canvas eDrawings Blink 3D Trial Minos FreeCAD Bishop3D K3DSurf DesignWorkshop GDesign Sweet Home 3D TrueSpace Alibre Design Xpress 3DVIA Shape Wings 3D Sculptris Gimp Jasc Animation Shop FotoMorph Free Online: WeeWorld Manga Avatar Face Maker Custom Anime Cartoon Pho.to Wooz World Build Your Wild Self OSOQ Cartoonize photo to cartoon cartoonist cartoonize Not Free: KoolMoves Autodesk 3ds max Autodesk 3d design max Autodesk Maya Autodesk SoftImage XSI Autodesk MotionBuilder Autodesk Smoke Pixar Renderman Mudbox ZBrush DAZ 3D Modo Lightwave Houdini Eyeon Fusion Foundry Nuke Compositor Avid PF Track Adobe After Effect Adobe Illustrator Adobe Photoshop Adobe Premiere Sony Vegas Crazytalk
  7. One table of customers within , could be a million or so records of their mixed clients. If each customer was own table or database that would eliminate having to sort or create an index. A query to just an individual database or table and finding a single customer is lots faster than all one table.
  8. http://cassandra.apache.org/ Not much more to say more, all the big players use it, originally developed by facebook.
  9. Nobody will make this for you. I'll tell you how can make it though. Create a form to collect the clients data Incorporate a color chart to select colors Save the data into a database for later use Let clients upload own banner background or have a pile saved at the server have a custom swf file For the client to display embed... use their database data and load the flash vars loaderInfo.parameters http://www.permadi.com/tutorial/flashVars/indexAs3.html When a client embeds the flash banner...it would be an iframe to your site with url parameters linking it to their account in some way. A script on your server generates the iframe code with the users data (optionally doing an animated image) Generate new images using imagemagick
  10. You were trying to pass a mysql query where it needed to be a query string Try this instead <?php include 'connect.php'; $query = "SELECT * from player where name='Kronus'"; if ($result = mysqli_query($conn, $query)) { if(mysqli_num_rows($result) > 0){ while ($row = mysqli_fetch_assoc($result)) { echo "Kronus's email is " . $row['email']; } } else { die ("could not select players"); } } else { die ("query failed"); } mysqli_close($conn); ?>
  11. A tool for testing your htaccess rules online http://htaccess.madewithlove.be/
  12. A tool for testing your htaccess rules online http://htaccess.madewithlove.be/
  13. That's the default unless you add a different rewrite rule flag that's what it does. The reason I mentioned about the order of the rules. If for some reason you want to rename a directory or file then you would want it before this rule below You have RewriteCond %{REQUEST_FILENAME} -d [OR] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -l RewriteRule ^ - [L] The [L] flag causes mod_rewrite to stop processing the rule set. In most contexts, this means that if the rule matches, no further rules will be processed My meaning was you may want that for just specific rewrite rules Consider the case when using the S flag The flag is used to skip rules that you don't want to run. # Is the request for a non-existent file? RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # If so, skip these two RewriteRules RewriteRule .? - [s=2] RewriteRule (.*\.gif) images.php?$1 RewriteRule (.*\.html) docs.php?$1
  14. The easiest way to do it would be using a jquery slideshow
  15. No idea why, but if just need the speed of the connection transfer can use this I would use curl for the connection. Do you really want a 120 second timeout? <?php $url ="http://solve-ict.com/wp-content/themes/ict%20theme/js/jquery-1.7.1.min.js"; $start_request = microtime(true); $data = @file_get_contents($url); $end_request = microtime(true); if(!$data){ echo 'Timed Out'; } else { echo $time_taken = round(($end_request - $start_request),2); } ?>
  16. I don't understand what you want to do. Put what back on the same page? Do you mean to echo out results from the while loop in a divider? mysqli_fetch_assoc Post your code here and try to explain where the issue is. Use the <> button to post code
  17. $salt = $nresult['salt']; You have no column named salt in your database table.
  18. json_decode() Once you have them in an array $fields = http_build_query($json_array); //builds the query this is the count of how many post fields are sending curl_setopt($ch, CURLOPT_POST, count($fields));
  19. My impression is that the "customers" will be something like an entire electric company with all of their customers within. It sounds like databases or tables wouldn't be made that often as are most likely large accounts.
  20. I noticed you are getting a post id, if you set id as the primary and use autoincrement in mysql you don't even have to pass an id in the insert query Each new entry would get the next incremental id automatic. http://dev.mysql.com/doc/refman/5.7/en/example-auto-increment.html
  21. You know your business the best. If you are doing large amounts of data with many customers... having them across different databases and possibly even multiple servers would be the best. Can most likely get away with doing new tables per customer If is a multiple table setup per customer I would say own database I wouldn't even consider all customers in the same table my first thought would be expansion , don't really want to do piles of queries per customer to populate new tables in a table you already know is that customer, if was a shared table now has to sift or sort through it table would become huge tables can corrupt, want all your customers complaining or just one also have to consider table locking for inserts and selects does your api allow the customer direct access? is there security or permissions? the more you separate your data the easier it will be to maintain your customers and more efficient
  22. BTW, stop by php.net if you want to learn php
  23. You can add GET parameters to the urls to control what content is being viewed http://mysite.com/?location=home retrieve the get query and use it's values if(isset($_GET['location']) && trim($_GET['location']) != ''){ $location = trim($_GET['location']); } else { $location = 'home'; } You can include a page using this data or use it dynamic in a database query to change the results in the same script I'll use categories as an example $sql = "SELECT * FROM table_name WHERE category='$location'"; a php page including scripts within (very basic example) <?php //creates the pages array //make a php script for each item in the array $pages = array( "home", "about", "contact", "links", "post" ); //loop the pages as href links foreach ($pages as $page) { echo "<a href='?location=$page'>$page</a> "; } //GET from address bar if (isset($_GET['location']) && in_array(trim($_GET['location']), $pages)) { $location = trim($_GET['location']); } else { $location = 'home'; } //so can see it work echo "<h2>".$location."</h2>"; //include a page $script = dirname(__FILE__) . DIRECTORY_SEPARATOR . $location.".php"; if (file_exists($script)) { include($script); } else { echo "That page does not exist."; } ?>
  24. In the query you need to use the table name, not the database name. $sql = "INSERT INTO table_name (studentID, lastName, firstName, middleName, courseName, courseNumber, year, grade, gender) VALUES ('$id','$lastname','$firstname','$middlename','$coursename','$courseID','$year','$grade', '$sex')"; $conn->exec($sql);
  25. I'll ramble on about a few things. These may be useful to you http://httpd.apache.org/docs/trunk/urlmapping.html http://www.askapache.com/htaccess/mod_rewrite-variables-cheatsheet.html When you do your rewrite in htacces exclude for if is a file or directory You must do this before every rewrite rule you need it for not a file RewriteCond %{SCRIPT_FILENAME} !-f not a directory RewriteCond %{SCRIPT_FILENAME} !-d The order you write your rewrite rules will matter a lot. apache absolute versus relative URL-path A DocumentRoot-relative path to the resource to be served. Note that mod_rewrite tries to guess whether you have specified a file-system path or a URL-path by checking to see if the first segment of the path exists at the root of the file-system. For example, if you specify a Substitution string of /www/file.html, then this will be treated as a URL-path unless a directory named www exists at the root or your file-system (or, in the case of using rewrites in a .htaccess file, relative to your document root), in which case it will be treated as a file-system path. If you wish other URL-mapping directives (such as Alias) to be applied to the resulting URL-path, use the [PT] flag as described below. Absolute URL If an absolute URL is specified, mod_rewrite checks to see whether the hostname matches the current host. If it does, the scheme and hostname are stripped out and the resulting path is treated as a URL-path. Otherwise, an external redirect is performed for the given URL. To force an external redirect back to the current host, see the [R] flag below. lets talk relative, absolute and local urls A path is a slash separated list of directory names followed by either a directory name or a file name. A directory is the same as a system folder. network-path reference: If you need to include something on multiple scheme/protocols like both http:// and https:// <script src="//mysite.com/script.js"></script> if you’re viewing the file local, it’ll try to request with file:// relative paths: hash tag # (by itself directs to same page, if a fragment is added usually an anchor tag on the same page......but sites have been using them to navigate entire sites or scripts with them over the years) no identifier (just a directory or file) will append own host same directory / root directory ./ up one directory ../ up two directories ../../ up three directories ../../../ on and on for up directories absolute paths: any url (more correctly called uri) that includes the protocol and host with optional others following it just a few examples, is way too many to list every possible type. http://subdomain.domain.tld.sld/directory/file.ext?query=value#fragment http://subdomain.domain.tld/ http://subdomain.domain.tld.sld/folder/script.php http://domain.tld/script.php local paths: sometimes linked when are outside of the www directory C:\folder\ C:\folder\file C:/folder/file.ext \\folder\file If you include the same scripts with the same relative paths above or deeper in folders some are going to break. The absolute paths will always be the location you specify. You could do some discovery using $_SERVER variables Providing your configuration is correct <VirtualHost *> ServerName mysite.com UseCanonicalName on </VirtualHost> defined in server config $_SERVER['SERVER_NAME'] mysite.com obtained from the HTTP request header $_SERVER['HTTP_HOST'] mysite.com if you used this on a server not using port 80 would also show the port, SERVER_NAME would not $_SERVER['DOCUMENT_ROOT'] /var/www/ , C:/wamp/www $_SERVER['SCRIPT_FILENAME'] /index.php same path whether it is used in the main file or in an included file host and script $current_url = filter_var("http://" . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME'], FILTER_SANITIZE_STRING); include the query if exists if (!empty($_SERVER['QUERY_STRING'])) { $query_string = filter_var($_SERVER['QUERY_STRING'], FILTER_SANITIZE_STRING); $current_url .= "?" . $query_string; } onto magic constants you can do something like this to include files include_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . ‘database.class.php); $_SERVER['SCRIPT_FILENAME'] versus __FILE__ SCRIPT_FILENAME returns the same path whether it is used in the main file or an included file __FILE__ returns the path of included file if used inside an included file also the path of the main file if was included in that To sum it up, you have to figure out which methods best suit your needs and plan it out.
×
×
  • 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.