802 Posted Topics

Member Avatar for mrhankey

Use the "week" modificators for grouping on your date field. [CODE]SELECT * FROM mytable group by date_format(mydate,'%U') as week [/CODE]

Member Avatar for mrhankey
0
5K
Member Avatar for abhi10kumar

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 …

Member Avatar for smantscheff
0
131
Member Avatar for sid78669

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 …

Member Avatar for smantscheff
0
193
Member Avatar for lashatt2

No it's not. In SQL you'll need the SELECT statement: [CODE]SELECT yutis_raod FROM theTable; [/CODE]

Member Avatar for smantscheff
0
115
Member Avatar for Venom Rush

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.

Member Avatar for Venom Rush
0
2K
Member Avatar for ddellostritto

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 …

Member Avatar for mschroeder
0
137
Member Avatar for uopdom

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.

Member Avatar for griswolf
0
105
Member Avatar for john0563

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 …

Member Avatar for vsmash
0
597
Member Avatar for ptara1

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.

Member Avatar for ptara1
0
2K
Member Avatar for baziili

You have to separate statements by a semicolon. Please show the file which does not upload.

Member Avatar for mwasif
0
303
Member Avatar for codeblock
Member Avatar for codeblock
0
138
Member Avatar for newbie14

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.

Member Avatar for smantscheff
0
154
Member Avatar for arv3

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', …

Member Avatar for smantscheff
0
243
Member Avatar for shdwmage

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 …

Member Avatar for smantscheff
0
131
Member Avatar for feoperro

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.

Member Avatar for smantscheff
0
171
Member Avatar for emulman

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.

Member Avatar for emulman
0
205
Member Avatar for flinthabbit

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]

Member Avatar for flinthabbit
0
117
Member Avatar for freakunleash

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 …

Member Avatar for freakunleash
0
215
Member Avatar for agriz

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 …

Member Avatar for smantscheff
0
314
Member Avatar for Imratzio

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]

Member Avatar for Imratzio
0
2K
Member Avatar for anita_86

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.

Member Avatar for smantscheff
0
72
Member Avatar for ptara1

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] …

Member Avatar for ptara1
0
180
Member Avatar for jrotunda85

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 …

Member Avatar for smantscheff
0
2K
Member Avatar for uopdom

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]

Member Avatar for uopdom
0
834
Member Avatar for dudzkie

Assuming you are using mysql you can limit the result with a LIMIT clause in your select statement.

Member Avatar for jimforsyth
0
72
Member Avatar for lulemurfan

In standard configuration this error message is accompagnied by the file name and line number where the output started. Did you look there?

Member Avatar for jimforsyth
0
94
Member Avatar for banmikko
Member Avatar for alim18

They did it with some javascript functionality which you can find here: [url]http://www.paid-surveys-at-home.com/maxheight.js[/url]

Member Avatar for alim18
0
263
Member Avatar for AntiNL

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 …

Member Avatar for smantscheff
0
259
Member Avatar for nats01282

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]

Member Avatar for smantscheff
0
357
Member Avatar for carebear23

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 …

Member Avatar for Web Dev Rob
0
124
Member Avatar for webteam

[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 …

Member Avatar for jlego
0
428
Member Avatar for terabyte

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 …

Member Avatar for smantscheff
0
113
Member Avatar for abhi10kumar
Member Avatar for banmikko

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]?

Member Avatar for smantscheff
0
205
Member Avatar for matt.clark.228

The code is fine - at least it runs on my Apache installation, and the output is "1", as expected.

Member Avatar for smantscheff
0
129
Member Avatar for VanHackman

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" );

Member Avatar for smantscheff
0
2K
Member Avatar for Brianbc

Thank you for sharing. But who would want to use this instead of a simple CREATE TABLE query?

Member Avatar for Brianbc
0
239
Member Avatar for Zolcos

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]). …

Member Avatar for smantscheff
0
748
Member Avatar for ptara1

Change [ICODE]if(preg_match("/^[ a-zA-Z]+/", $_POST['search'])[/ICODE] to [ICODE]if(preg_match("/^[ a-zA-Z0-9]+/", $_POST['search'])[/ICODE]

Member Avatar for smantscheff
0
79
Member Avatar for TheIdiot

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 …

Member Avatar for shdwmage
0
128
Member Avatar for rajeesh_rsn

You should set up the "date" column as a true date field, not as a character field. Then you could sort by this field.

Member Avatar for d5e5
0
114
Member Avatar for Acute
Member Avatar for ditty

Look here: same problem, solution: mysql inline functions to order by. [url]http://www.daniweb.com/forums/thread345754.html[/url]

Member Avatar for mahavir123
0
90
Member Avatar for Ignatius88

Run your prepared statement from the mysql command line which will tell you what went wrong.

Member Avatar for smantscheff
0
3K
Member Avatar for thijscream

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 …

Member Avatar for smantscheff
0
2K
Member Avatar for ian paul

Try google. [url]http://www.phpclasses.org/package/2874-PHP-Recognize-text-objects-in-graphical-images.html[/url]

Member Avatar for smantscheff
0
52
Member Avatar for veledrom

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.

Member Avatar for pritaeas
0
91
Member Avatar for jward50

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 …

Member Avatar for smantscheff
0
60
Member Avatar for rohit b k

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 …

Member Avatar for smantscheff
0
100

The End.