802 Posted Topics
Re: Use the "week" modificators for grouping on your date field. [CODE]SELECT * FROM mytable group by date_format(mydate,'%U') as week [/CODE] | |
Re: 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 … | |
Re: Drop the @ variable marker from your procedure: [ICODE] 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 … | |
Re: No it's not. In SQL you'll need the SELECT statement: [CODE]SELECT yutis_raod FROM theTable; [/CODE] | |
Re: 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. | |
Re: 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 … | |
Re: 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. | |
Re: 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 … | |
Re: 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. | |
Re: You have to separate statements by a semicolon. Please show the file which does not upload. | |
| |
Re: I don't know about the load distribution and the lack of it, but have a look at the slow query log of mysql to see if you can optimize applications on that level. Also check if all indexes are intact. | |
Re: 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 [ICODE]mysql_set_charset( "utf8", $connection ); mysql_query("SET character_set_results = 'utf8', character_set_client = 'utf8', character_set_connection = 'utf8', character_set_database = 'utf8', … | |
Re: I believe you are barking up the wrong tree. Storing image data in the database does not affect database performance. Database performance is mainly determined by table structure and indexes, not by the amount of data stored in the DB. If pictures have their own table and you use the … | |
![]() | Re: 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. |
Re: 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. | |
Re: This is correct, but for debugging purposes you should replace your error messages by something meaningful, viz. mysql_error() [ICODE]$link = mysql_connect($DBSERVER, $DBUSER, $DBPASS) or die(mysql_error()); mysql_select_db($DB, $link) or die (mysql_error());[/ICODE] | |
Re: 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 … | |
Re: You cannot reduce the number of queries. You need a subset of questions, but for each question a complete set of choices. You cannot do the following because mysql doesn't allow limits in subsets: [CODE]select * from questions q, choices c where q.question_id = c.question_id and q.question_id in (select question_id … | |
Re: Your delete query is malformed and nonsense. [ICODE]$sql = "DELETE FROM products WHERE id='$id_to_delete" or die(mysql_error()); $result = mysql_query ($sql);[/ICODE] should read [ICODE]$sql = "DELETE FROM products WHERE id='$id_to_delete'"; $result = mysql_query ($sql) or die(mysql_error()); [/ICODE] | |
Re: 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. | |
Re: Do you mean: how can you attribute values to form elements before the form is delivered to the user? Basically, your hyperlink should contain the ZipCat element as a get parameter to the php script which contains the form. Example: Change [ICODE] echo "<td>" . $row['ZipCat'] . "</td>";[/ICODE] to [ICODE] … | |
Re: In the long run it pays to have your data as structured and un-redundant as possible. So I support pritaeas' advice to use lookup tables for coded values. Regarding efficiency and performance, with properly set indexes you will not notice any difference if you use text strings or code numbers … | |
Re: Please show the "CREATE TABLE Users" statement. And for debugging change [CODE] $result = mysql_query($query); [/CODE]to [CODE] $result = mysql_query($query) or die(mysql_error());[/CODE] | |
Re: Assuming you are using mysql you can limit the result with a LIMIT clause in your select statement. | |
Re: In standard configuration this error message is accompagnied by the file name and line number where the output started. Did you look there? | |
Re: Do you mean that you want to show the image in your form? | |
Re: They did it with some javascript functionality which you can find here: [url]http://www.paid-surveys-at-home.com/maxheight.js[/url] | |
Re: When you upload something through PHP, then on the server the upload is done by the process which is running the webserver. This process usually is associated with a user called www or apache or www-data etc. This user has to have write permissions to the directories involved, otherwise your … | |
Re: You can have it also the easy way and code the values into you HTML. Then you can store them without any conversion: [ICODE]<select name="chr_pet"> <option value="10">Pig</option> <option value="20">Dragon</option> <option value="30">Cow</option> <option value="40">Horse</option> <option value="50">Bear</option> </select>[/ICODE] | |
Re: This looks like a good start. Make a list of all business transactions and check if you can map them to your database structure in all details. I do not understand the relation between orders, parts and products. What is a part? How does it relate to products? How many … | |
Re: [QUOTE]I want all the states to show up in the suggestions whether we have jobs in the state or not. Hopefully, that makes sense.[/QUOTE] No it doesn't. Why would you show states for which you don't have jobs? To make the user believe that you have a large database? To … | |
Re: text data type is for very long texts. MySQL doesn't allow for indexes of more than 1024 characters, so you couldn't index a full length text field, but you can index the whole of a varchar field. URLs can be more than 1.000 chars long, though. So if you plan … | |
| |
Re: How does the resulting HTML source code look? Did you really use [ICODE]$targetpath [/ICODE]as variable name, or shouldn't ir read [ICODE]$target_path[/ICODE]? | |
Re: The code is fine - at least it runs on my Apache installation, and the output is "1", as expected. | |
Re: Set the connection character set to utf-8, too. mysql_query("SET character_set_results = 'utf8', character_set_client = 'utf8', character_set_connection = 'utf8', character_set_database = 'utf8', character_set_server = 'utf8'"); or mysql_set_charset( "utf-8" ); | |
Re: Thank you for sharing. But who would want to use this instead of a simple CREATE TABLE query? | |
Re: I don't have a clue, but if this was my problem I would dump the database content and all configuration files and look for the function name. Maybe this provides a hint. The mysql manual says that you get into trouble if your server runs with the option --skip-grant-tables ([url]http://dev.mysql.com/doc/refman/5.0/en/udf-compiling.html[/url]). … | |
Re: Change [ICODE]if(preg_match("/^[ a-zA-Z]+/", $_POST['search'])[/ICODE] to [ICODE]if(preg_match("/^[ a-zA-Z0-9]+/", $_POST['search'])[/ICODE] | |
Re: The distinctive feature of the controls is their html property "name". Build the names as unique strings using the group member IDs, so that your controls have names like [ICODE]cb1_1, cb_1_2, cb2_1, cb2_2[/ICODE] and so on. Then on the receiving side walk through the $_POST array and check each input … | |
Re: You should set up the "date" column as a true date field, not as a character field. Then you could sort by this field. | |
Re: Look here: same problem, solution: mysql inline functions to order by. [url]http://www.daniweb.com/forums/thread345754.html[/url] | |
Re: Run your prepared statement from the mysql command line which will tell you what went wrong. | |
Re: You are confusing file names and page titles. The page title which a browser shows is stored in the html <title> element. You can redirect file names in the apache webserver using the redirect module (ModRewrite). If the redirect engine is installed and active and redirection is allowed for your … | |
Re: Try google. [url]http://www.phpclasses.org/package/2874-PHP-Recognize-text-objects-in-graphical-images.html[/url] | |
Re: That's correct. A standard barcode scanner is an input device which transmits character data into the keyboard buffer. You have to store them in the same manner as if they had been typed in via a keyboard. | |
![]() | Re: You cannot have that (columns acting as rows) in standard SQL. You will have to walk through the result set and format a report based on grouping by organization. In MySQL you can maybe make use of the group_concat() function: group by organization and concatenate the areas of interest in … |
Re: If your raw image data are stored in a database, you need a script which not only retrieves them but also adds the html image headers. For example with JPEG images, you might code something like this: [ICODE]<?php [... your database connector retrieves image data as $imgdata with a query … |
The End.