802 Posted Topics

Member Avatar for samsambm

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]

Member Avatar for smantscheff
0
80
Member Avatar for tiggsy

Maybe you want SHOW CREATE TABLE which retrieves the table definition. From this you can extract all your enum (set) fields.

Member Avatar for diafol
0
165
Member Avatar for deolalkar_pooja

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 …

Member Avatar for deolalkar_pooja
0
325
Member Avatar for deolalkar_pooja

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

Member Avatar for smantscheff
0
74
Member Avatar for lkrvk

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

Member Avatar for smantscheff
0
163
Member Avatar for haithomy

What do you mean with "too long"? Does the query take to long? Add indexes to the fields ad_country and approve.

Member Avatar for dipakatcvrca
0
86
Member Avatar for Fancycoder

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

Member Avatar for smantscheff
0
856
Member Avatar for cliffcc

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.

Member Avatar for cliffcc
0
232
Member Avatar for nats01282
Member Avatar for bangla

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.

Member Avatar for diafol
0
84
Member Avatar for samsambm
Member Avatar for LWS

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 …

Member Avatar for LWS
0
141
Member Avatar for shakeit13aby

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

Member Avatar for smantscheff
0
88
Member Avatar for thunderbird22

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

Member Avatar for smantscheff
0
164
Member Avatar for epicrevolt

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]

Member Avatar for epicrevolt
0
885
Member Avatar for dyla123

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?

Member Avatar for dyla123
0
147
Member Avatar for roachae

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?

Member Avatar for smantscheff
0
235
Member Avatar for rkayd

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 …

Member Avatar for diafol
0
102
Member Avatar for wingmark

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.

Member Avatar for diafol
-1
216
Member Avatar for kadriirdak
Member Avatar for kadriirdak
0
175
Member Avatar for simplyit
Member Avatar for deolalkar_pooja

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 …

Member Avatar for smantscheff
0
143
Member Avatar for lkrvk
Member Avatar for lloydsbackyard

[CODE]select a.*,b.*,c.* from a join b on a.x=b.x join c on b.x=c.x [/CODE]or [CODE]select a.*,b.*,c.* from a join b on a.x=b.x join c on a.x=c.x [/CODE]

Member Avatar for smantscheff
0
44
Member Avatar for Sahilsahni

You can add headers as a 4th parameter of the mail function. Try "From:xyz@maindomain.com\r\n\Reply-to:xyz@maindomain.com"

Member Avatar for d3rck
0
299
Member Avatar for mrhankey

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.

Member Avatar for mrhankey
0
159
Member Avatar for fuston05

Filter the "." before you insert it. You can replace the period by applying replace(): [CODE]INSERT INTO mytable myvalue VALUES (replace('1.000','.','')); [/CODE]

Member Avatar for fuston05
0
189
Member Avatar for JerieLsky
Member Avatar for tcollins412

With a Rewrite rule in the server configuration. Study the Apache RewriteEngine module.

Member Avatar for chrishea
0
204
Member Avatar for fuston05

On PHP level you can use regular expressions. Look up the manual for the preg_... functions.

Member Avatar for fuston05
0
77
Member Avatar for MargateSteve

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.

Member Avatar for smantscheff
1
306
Member Avatar for Agent-of-Chaos

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]

Member Avatar for smantscheff
0
147
Member Avatar for peterbata

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 …

Member Avatar for peterbata
0
387
Member Avatar for agriz
Member Avatar for smantscheff
0
104
Member Avatar for bangla

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 …

Member Avatar for 84hd0ns
0
226
Member Avatar for bangla

To redirect the browser, output a "Location: ..." header or its meta-tag equivalent.

Member Avatar for 84hd0ns
0
143
Member Avatar for programmer12

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.

Member Avatar for smantscheff
0
345
Member Avatar for indr
Member Avatar for luweegee
Member Avatar for luweegee
0
99
Member Avatar for brianjoe

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]

Member Avatar for smantscheff
0
152
Member Avatar for McLaren
Member Avatar for aksahoo17

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.

Member Avatar for Gfaith31
0
379
Member Avatar for stanley87

It would be easier for us to help you if you would clearly state your problem.

Member Avatar for stanley87
0
195
Member Avatar for feoperro

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.

Member Avatar for feoperro
0
193
Member Avatar for bjeffries

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

Member Avatar for smantscheff
0
247
Member Avatar for blocblue

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 …

Member Avatar for blocblue
0
143
Member Avatar for yamot47

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]

Member Avatar for yamot47
0
222
Member Avatar for stv_101

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 …

Member Avatar for Javvy
0
179
Member Avatar for andrewliu

Yes, as an image. If it doesn't have to be *that* exact a copy, google for pdf2html and doc2html.

Member Avatar for smantscheff
0
52
Member Avatar for mrhankey

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 …

Member Avatar for smantscheff
0
203

The End.