802 Posted Topics
Re: No. You have to use comparison operators on table pairs. [CODE]SELECT * FROM users_tbl,events_tbl,players_tbl,sales_tbl,teachers_tbl WHERE users_tbl.user_id=events_tbl.user_id and events_tbl.user_id=players_tbl.user_id and players.tbl_user_id=sales_tbl.user_id and sales_tbl.user_id=teachers_tbl.user_id and users_tbl.user = '$whois_id' [/CODE] | |
Re: Maybe you want SHOW CREATE TABLE which retrieves the table definition. From this you can extract all your enum (set) fields. ![]() | |
Re: patindex() is not a mysql function. You cannot use it in a select clause unless you define the function first. To select all names like "%a%", use the like operator: [CODE]SELECT * FROM publisher where name like "%a%";[/CODE] To use aggregate functions like sum() or avg() you need an GROUP … | |
Re: [url]http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_date-format[/url] [CODE]select date_format( dob,'%M'); [/CODE] | |
Re: It is a bad idea to have structurally identical tables created at runtime. What for? Put all the info in one table. If you still want to do it that way, set correct quotes in your query. Within single quotes PHP will not replacement variables, with double quotes it will. … | |
Re: What do you mean with "too long"? Does the query take to long? Add indexes to the fields ad_country and approve. | |
Re: Include the <div>... pattern into the search pattern and replace it by itself. [CODE]<?php $message = '<div class="sacred">[url]http://www.daniweb.com/[/url] is inside the div tag so I do not want it replaced.</div>[url]http://www.google.com/[/url] is outside the div tag so I do want it replaced'; $exclude = '<div class=\"sacred\">.*?<\/div>'; $pattern = '(https?\:\/\/.*?\..*?)(?=\s|$)'; $message= preg_replace("~(($exclude)?($pattern))~i", … | |
Re: Try to state your problem and show the relevant parts of your code instead of posting all your code and leaving us to find out what you are looking for. | |
Re: Google for "sql injection". Protect your database (in gdform.php), not your form. You cannot do anything against malicious data coming in. But you can protect against processing it. ![]() | |
Re: Replace = by == in your comparison statements. | |
Re: 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 … | |
Re: [ICODE]drop table if exists calculation; create table calculation (one float, two float, sign enum('+','-','*','/'),answer float); insert into calculation (one,two,sign) values (1,2,'+'),(1,2,'-'),(1,2,'*'); UPDATE calculation SET answer = CASE sign WHEN '+' THEN one+two WHEN '-' THEN one-two WHEN '*' THEN one*two ELSE answer=one/two END ; +-----+-----+------+--------+ | one | two | … | |
Re: //if accept is pressed if ($_POST['submit'] == 'Accept') { //do this... } //else if reject is pressed if ($_POST['submit'] == 'Reject') { //do this... } [ICODE]if($problem == "solved"){ clickLink("mark_as_solved"); }[/ICODE] | |
Re: Don't post irrelevant code. Try to pinpoint your problem. Replace all include() by require_once(). // ardav, you out there? I was here already... [ICODE]if($problem == "solved"){ clickLink("mark_as_solved"); }[/ICODE] | |
Re: API means Application Program Interface. What application are you talking about? Do you want to program a score list in PHP? What does your input look like? | |
Re: Add a CREATE TABLE and some INSERT statements for a complete test case for us. Have a look at the result of your query. Which row appears more than once? Change SELECT to SELECT DISTINCT. Does it change anything? | |
Re: You cannot do that in PHP without submitting the form, which would be an awkward user experience. Use JavaScript instead. Write a function which sets the one checkbox which changes "automatically" and call this function from the onclick events. And do yourself a favour and generate your repeating HTML code … ![]() | |
Re: Use the php dir class function: [url]http://php.net/manual/en/class.dir.php[/url] Come on, man, give it at least a try. ![]() | |
| |
Re: Try again, this time include the schema. | |
Re: Do you want to know the name of the Mumbai person of maximum age? Then you have to group by age, select the maximum of it and find a person of that same age: [CODE]select name from man m1 where m1.city = 'Mumbai' and m1.age = (select max(m2.age) from man … | |
Re: It's utterly nonsense to create a table for each new user. | |
Re: You can add headers as a 4th parameter of the mail function. Try "From:xyz@maindomain.com\r\n\Reply-to:xyz@maindomain.com" | |
Re: 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. | |
Re: Filter the "." before you insert it. You can replace the period by applying replace(): [CODE]INSERT INTO mytable myvalue VALUES (replace('1.000','.','')); [/CODE] | |
Re: The server has crashed. Restart it. | |
Re: With a Rewrite rule in the server configuration. Study the Apache RewriteEngine module. | |
Re: On PHP level you can use regular expressions. Look up the manual for the preg_... functions. | |
Re: 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. | |
Re: Why would checking the row count crash your DB? You could create a trigger which checks BEFORE INSERT that the row count does not exceed your maximum and reject the INSERT if it does. How to reject a row in a trigger: [url]http://forums.mysql.com/read.php?99,134466,134481#msg-134481[/url] | |
Re: If you have a good working knowledge of MS-Access and its ways there is no need to migrate the application to MySQL. But if you are determined to migrate, MySQL is a good choice - very performant, good functionality. Yes, you can strip the browser to a bare window. But … | |
Re: Your code is a syntactical nightmare. Strings in PHP have to be enclosed in single or double quotes. ($message = Name) You cannot open a <?php tag inside an already opened one. A tip: do not mix HTML and PHP code. Write code like yours this as pure PHP without … | |
Re: To redirect the browser, output a "Location: ..." header or its meta-tag equivalent. | |
Re: Headers may not be sent after any script or HTML output. Blank spaces are also output. Your output starts at <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 in header.php Rearrange your code so that no output precedes the header() function. | |
Re: You could also use a regular expression to extract the desired content: [CODE]if (preg_match( '~feedback_url':\s*'([^']+)',\s'file':\s*([^']+)'~, $sourcecode, $match )) { $feedback_url = $match[1]; $file = $match[2]; } [/CODE] | |
Re: Restart the mysql server. | |
Re: 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. | |
Re: It would be easier for us to help you if you would clearly state your problem. | |
![]() | Re: 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. ![]() |
Re: What do you mean with "is not working"? Your rule [ICODE]RewriteCond %{REQUEST_FILENAME}.php -f [/ICODE]requests that for a request like [ICODE]/abc [/ICODE] the file named [ICODE]/abc.php [/ICODE] exists. Is that what you want? Your last rule will never catch anything in its second pair of brackets. In [ICODE]RewriteRule ^(.*)(/?)$ index.php?p=$1 [L][/ICODE] … | |
Re: 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 … | |
Re: Any punctuation marks will help, too. Set the value of the button to the book id you want to retrieve. [CODE]echo("<td><INPUT TYPE=button id=show name=show value='" . $row['idbook_code'] . "'></td>");[/CODE] | |
Re: 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 … | |
Re: Yes, as an image. If it doesn't have to be *that* exact a copy, google for pdf2html and doc2html. | |
Re: 1) [url]www.netuse.de[/url]. 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 … |
The End.