Yes, as an image.
If it doesn't have to be *that* exact a copy, google for pdf2html and doc2html.
smantscheff 265 Veteran Poster
Yes, as an image.
If it doesn't have to be *that* exact a copy, google for pdf2html and doc2html.
I've not yet seriously looked into MySQL clustering and partitioning, but maybe you should.
Problems can arise if locally entered data collide with online data - for example if you have a lookup table which should be synchronized. But as need be, a new value will be locally entered which is not in the online version and you'll get a key clash. So your local staff would really be limited to entering new data - no editing, no deleting etc. It's technically feasible, but would be a very unflexible way of setting up an application. I'd rather opt for a local replication of the online master database which is updated in short intervals - every few minutes or so. If the connection goes down, let the local staff switch to the local version with limited functionality (entering new data only) and re-synch with the master database and the full-scale application when the connection is up again.
phpMyAdmin has a dump option built in, and Navicat has, too.
How would you know that data are sorted? MySQL does not guarantee you any sequence of records if you do not use an ORDER BY clause.
What you can do, though, is to create a new table and SELECT your data INTO this table in a certain sort order.
There is nothing in the IT world which happens automatically.
To make the /contact link work, you'll first have to install the modification from my previous post.
The code is working. Try http://kbrlifestyles.com/bootcamp.html
Now you will have to modify it to suit your needs. Start with
RewriteRule ^([a-z0-9]+)(.htm(l)?)?$ index.php?p=$1 [L]
(Sub)Version control lets you develop the website on your development system and roll it out through controlled and easyly synced channels. In a proper setup you can sync your (slave) servers to your (master) development machine with a click.
Regarding the database, its easier to have one central database to which all webservers connect than a distributed system. If you need a distributed database for performance, install a MySQL cluster.
Both sites have the same setup (LAMP), and the website scripts are controlled by SVN (or another version control tool) so that they can easily be updated. The content is in the database of which there is only one.
What do you mean with "is not working"?
Your rule RewriteCond %{REQUEST_FILENAME}.php -f
requests that for a request like /abc
the file named /abc.php
exists. Is that what you want?
Your last rule will never catch anything in its second pair of brackets. In RewriteRule ^(.*)(/?)$ index.php?p=$1 [L]
the first bracket pair catches all content.
1) www.netuse.de. I don't know if they have an english interface, but they have a support which does it's job.
2) How much traffic will the users generate? In general, I'd say: it doesn't matter. The standard shared machine which you can rent for a few bucks will do the job with ease.
Start with a small box. If traffic grows, move database and server to two different small machines. If it still grows, add another web server and a load balancer. If it still grows, move your (mysql) database to a cluster.
The easy way:
- Create at web page which does the task.
- Set up a cron job which downloads this page at times using wget or curl.
If you have php as a stand-alone application on your server (not only as a webserver module), you can directly call "php myscript.php" from your cronjob at certain times.
To create a cronjob in linux, enter "crontab -e" on the command line.
If you want to populate the dropdown boxes without reloading the page, you'll have to use javascript.
Either you use an AJAX request for them, or you load all relevant data in your page and switch the drop down box content using some Javascript functionality.
If you want to do it in PHP only, you will have to re-submit the page when the user selects a list item and then populate the dependent lists in PHP.
Post codes and coordinates should be freely available.
http://news.bbc.co.uk/2/hi/technology/8402327.stm
Drop the @ variable marker from your procedure:
drop table if exists points;
create table points (
BID int(11) not null,
bLevel int(11) not null,
Points int(11) not null);
insert into points values (1,1,10);
drop procedure `GetPoints`;
delimiter //
CREATE procedure `GetPoints`(IN BuildingID INT, IN BuildingLevel INT, OUT Pts INT)
BEGIN
Select Points
INTO Pts
From Points
Where BID = BuildingID AND bLevel = BuildingLevel;
END //
delimiter ;
set @pts = 9;
CALL GetPoints(1,1,@pts);
Select @pts;
+------+
| @pts |
+------+
| 10 |
+------+
AutoIncrement fields are integer in mysql.
You can mirror the auto-increment field in a varchar field and create a trigger which updates the varchar field on insert/update.
No it's not. In SQL you'll need the SELECT statement:
SELECT yutis_raod FROM theTable;
If you have geo-coordinates for the postcodes, you can set up a function which calculates the distance between two postcodes and a query which selects the minimum. You can do the math also in an inline function - look up "distance geo-coordinates" in google.
Try this:
create view view1 as
SELECT *,
COUNT(CASE WHEN games.competition = 1 AND appearances.type = 1 THEN 1 ELSE NULL END) AS lgest,
COUNT(CASE WHEN games.competition = 1 AND appearances.type = 2 THEN 1 ELSE NULL END) AS lgesub,
COUNT(CASE WHEN games.competition = 1 AND appearances.type = 3 THEN 1 ELSE NULL END) AS lgebench,
COUNT(CASE WHEN games.competition = 2 AND appearances.type = 1 THEN 1 ELSE NULL END) AS facst,
COUNT(CASE WHEN games.competition = 2 AND appearances.type = 2 THEN 1 ELSE NULL END) AS facsub,
COUNT(CASE WHEN games.competition = 2 AND appearances.type = 3 THEN 1 ELSE NULL END) AS facbench,
COUNT(CASE WHEN games.competition = 3 AND appearances.type = 1 THEN 1 ELSE NULL END) AS fatst,
COUNT(CASE WHEN games.competition = 3 AND appearances.type = 2 THEN 1 ELSE NULL END) AS fatsub,
COUNT(CASE WHEN games.competition = 3 AND appearances.type = 3 THEN 1 ELSE NULL END) AS fatbench,
COUNT(CASE WHEN games.competition = 4 AND appearances.type = 1 THEN 1 ELSE NULL END) AS kscst,
COUNT(CASE WHEN games.competition = 4 AND appearances.type = 2 THEN 1 ELSE NULL END) AS kscsub,
COUNT(CASE WHEN games.competition = 4 AND appearances.type = 3 THEN 1 ELSE NULL END) AS kscbench,
COUNT(CASE WHEN games.competition = 5 AND appearances.type = 1 THEN 1 ELSE NULL END) AS lcst,
COUNT(CASE WHEN games.competition = 5 AND appearances.type = 2 THEN 1 ELSE NULL END) AS lcsub,
COUNT(CASE WHEN games.competition = 5 AND appearances.type = 3 THEN 1 ELSE NULL END) AS lcbench,
COUNT(CASE …
Do your checking in the same script as the form display. Set your form action to "myformscript.php#contact" and relocate the user only after the form has successfully been submitted.
The question is, which values do you want to insert? First write a SELECT query which retrieves them, then build an INSERT query from there, in the form of
INSERT INTO case SELECT ...
INSERT INTO action SELECT ...
By the way, it's a bad idea to call a table "case" because case is a reserved word in nearly every programming language, including MySQL.
For a cart store the item IDs in an array as a session variable.
A better practice would be to first send a test mail to the mail server directly from the PHP script with an SMTP protocol emulation. So you can check if the entered address is valid and known. Otherwise you might lose visitors who erroneously enter a wrong email address and never receive their confirmation link.
If the address is valid, you will still need the confirmation mechanism to protect yourself against spammers.
Any punctuation marks will help, too.
Set the value of the button to the book id you want to retrieve.
echo("<td><INPUT TYPE=button id=show name=show value='" . $row['idbook_code'] . "'></td>");
Intermedia result: switch the table sequence in your join clauses from
FROM goals, games INNER JOIN players
to
FROM games, goals INNER JOIN players
and likewise
FROM appearances, games INNER JOIN players
to
FROM games, appearances INNER JOIN players
to get the query to run (on mysql 5.1.41-3ubuntu12.6).
But the queries have empty results. The players table is missing in your dump file. So I have to take back my "kudos" - test case not complete.
You could create views from both queries and join them on the player_id - or couldn't you?
I'd rather go one step back and ask: What for do you need a value in a table which can be computed by values from other tables? This is violating the normalization design principles. I you can replace the Phonebook table by a view, you should do so.
Put the image file name in quotes: "CClogo.jpg"
Make sure that the upper/lowercase spelling of the filename is correct.
Make sure that picscript1.php does not output any characters after the image data. It's good practice to delete the closing ?> php bracket from scripts which do not output HTML.
You can, if you assign the variables first. And for readablity I think it's easier to integrate the variables in the string (at least if you're using a decent PHP editor with syntax highlighting).
$name = $result['name'];
$bio = $result['bio'];
Print "<tr><td class='ParaText' align='left' valign='top'>name</td><td class='ParaText'>$name</td><td class='ParaText' align='left' valign='top'>$bio</td></tr>";
Your delete syntax is flawed. You're not supposed to use field names in DELETE statements. Try without.
%U is a formatting parameter for the date_format function which displays the week of the input date.
To match only the current week use
WHERE WEEK(somedatefield) = week(now())
Sorry, not much experience with it. Look here: http://dev.mysql.com/doc/refman/5.5/en/optimizing-the-server.html
Use the "week" modificators for grouping on your date field.
SELECT * FROM mytable group by date_format(mydate,'%U') as week
Since your system has lots of memory, try to increase all buffer and cache sizes by the factor 2 and see if it makes any difference for the server load.
Please check your data integrity by switching to InnoDB before further probing the problem.
Without taking a closer look, there is at least one thing fishy: Your tables are defined as MyISAM but use foreign keys. Foreign keys are meaningless in MySQL unless you use InnoDB tables. Therefore it might well be that your data are corrupted (violating relational integrity).
Show your CREATE TABLE statements and your code block.
Are these text data which you want to display in a google map? The only mechanism I know of is the HTML code which can be assigned to each marker and which opens on mouse-over. But it's too long since I did that. - You will have to generate some javascript code in your PHP which contains the tlf content and then use the google map API.
Here a snippet from another project of mine where an XML file containing locations has been read and now the locations are set on the google map with some html code in the overlay window.
function addOnlyOneMarker(location) {
var myPoint = new GLatLng( location.latitude.value, ocation.longitude.value);
var myMarker = new GMarker(myPoint);
map.addOverlay(myMarker);
var msg = location.name.value
+ '<br/>' + location.street.value
+ '<br/>' + location.zipcode.value
+ ' ' + location.town.value
+ '<br/>' + location.phone1.value;
myMarker.setImage(IMAGE_green);
myMarker.bindInfoWindow(msg, {onOpenFn: infowindowopen } );
}
$f = fopen( 'filename.txt', 'a' );
fwrite( $f, 'something' );
fclose( $f );
An interesting problem. I cannot get it to work, though, because MySQL keeps telling me
"ERROR 1054 : Unknown column 'scorer' in 'on clause"
Does anyone else have this problem, too? And maybe a solution?
And kudos for Steve for supplying a complete test case as a starting point.
For uploading images and other files there are lots of PHP scripts around for paste and copy.
For image processing you might use the gd library functions, or an external program like ImageMagick's "convert".
If you convert images on upload to the desired size you can also make sure that they are valid (e.g. with ImageMagick's "identify").
If each stock item has its own folder, count the items in it instead of storing a number in the database which may be out of sync at some point in time.
Keep in mind that for the number of subdirectories (your image folders) in one directory the same warning applies as for the number of files. If there are too many, performance will suffer. Use a hierarchical system which will guarantee a maximum number of entries per directory.
Try the mysql command line which will tell you about your error.
Check that the fields used as foreign keys have indexes.
Check that you're using InnoDb as storage engine for all tables.
Do you know how to insert data into a mysql database from the mysql command line? If not, learn that first. It will make the rest a lot easier.
Your PHP code shows no connection to a MYSQL database whatsoever. Study a primer about php and mysql first. Then come back and ask specific questions.
Use mysql_error() or the mysql command line interface to get at the error.
Sometimes I fear that for all the good reasons to use UTF-8, it has thrown us developers back into the times of ASCII/ANSI incompatibilities.
Make sure that *all* your connections use UTF-8. Use
mysql_set_charset( "utf8", $connection );
mysql_query("SET character_set_results = 'utf8', character_set_client = 'utf8', character_set_connection = 'utf8', character_set_database = 'utf8', character_set_server = 'utf8'", $cconnection);
bytes 0xF8 0x72 0x65 0x20
are not properly encoded UTF-8. Obviously they don't get converted on their way from the database to the XML file. Are you sure that their binary representation in the database is UTF? How did they get in the database?
MySQL's character set property can be misleading. MySQL does not automagically do character set conversions - only if client and server are announcing to use different character sets a conversion takes place. It's quite easy to be fooled to believe that your data are stored in UTF because the table or the field is defined using that character set. But if your store invalid UTF data in such a field, they stay invalid.
You don't need an online site. Set up your internet connection so that the store LAN will be accessible from outside through one certain port (which you set up). Establish a VPN from outside into your LAN, and the store owner may use this VPN to browse on your store-local installation.
Please mark this thread as solved.
Your table definition needs at least one field. And in the insert query each record (row) has to be in its own brackets. Try this:
CREATE TABLE `table_ro2` (theText text);
INSERT INTO `table_ro2` VALUES ('hello word'), ('how are you?'), ('what do you do?'), ('text nr. 4');
Have a look at your mysql configuration file my.cnf. There are numerous parameters which might limit the ressource usage of mysqld.
Use the mysql command line interface to get at the error message. Or use the mysql_error() function in PHP.
Check upper/lower case in table names.
SELECT INTO OUTFILE does not export the database structure. Also it's a nightmare to handle outfile names with it.
For on-demand backup write a shell script which does the backup using the mysqldump program and make it accessible via your HTML interface.