smantscheff 265 Veteran Poster

I don't know wordpress but I would assume they use date type fields for dates. In that case you have to format your input date accordingly:
SELECT * FROM 'wp_posts' WHERE 'post_date' < '2010-10-31';

smantscheff 265 Veteran Poster

As I said before, use the non-greedy modifier.
I forgot the ? after the first pattern.

<?php

$A[1] = 'auto">auto</a>, <a href="automobile">automobile</a>, <a href="motorcar">motorcar</a>, <a href="machine">machine</a></div><div class=Rel><a hr .................................... /tr><tr><td><a href="zw' ;

      if(preg_match('/^((.*?)">)?(.*?)</',$A[1],$B) == 1)
	      die($B[3]);
// result: auto
smantscheff 265 Veteran Poster
smantscheff 265 Veteran Poster

Still better, put the whole HTML code within PHP tags. It's much easier to read and to maintain.

<?php
for ($i = 0; $i <= 10; $i++)
{
	echo "
	<tr>
		<td>
			<input name='rate$i' id='rate$i' type='text' onkeyup='integeronly(this)' >
		</td>
		<td>
			<input name='qty$i' id='qty$i' type='text' onkeyup='integeronly(this)' >
		</td>
		<td>
			<input name='amt$i' id='amt$i' type='text' readonly='readonly'>
		</td>
	</tr>"
	;
}
?>
smantscheff 265 Veteran Poster

In the processing script, walk through the $_POST array and check which item of ckbox has a value assigned. Test it:

<form method='post'>
  <input type='checkbox' name='cb[]' value='a'>
  <input type='checkbox' name='cb[]' value='b'>
  <input type='submit' value='submit'>
</form>

<?php
  print_r( $_POST );
?>
smantscheff 265 Veteran Poster

You have to convert the array content to string literals. Like in

SELECT * FROM table WHERE shortcode IN ('a','b','c');
smantscheff 265 Veteran Poster

Use radio buttons. That's what they are for: selection of one of multiple values.

smantscheff 265 Veteran Poster

array_unique() keeps the indexes intact. If not specified otherwise, these are ascending integers.
Try this instead:

$pid = array_unique($pids);
foreach( $pid as $key => $value )
  echo "$key: $value<br/>";
smantscheff 265 Veteran Poster

Both in Linux and in Windows you can have filenames containing @, so that should not be the reason. It's rather the upload module which does some replacement operations on the filenames.

smantscheff 265 Veteran Poster

Grep all your source code and a database dump of your development database for the ƒ character. Make sure that the browser recognizes the correct character set (encoding).

smantscheff 265 Veteran Poster

Google for "ocr php". (OCR = Optical Character Recognition)

smantscheff 265 Veteran Poster
smantscheff 265 Veteran Poster

Where are the data (INSERT statements), where are your actual query parameters, where is the user table?

smantscheff 265 Veteran Poster

Create a lookup table for cities and link your publisher table to it.

smantscheff 265 Veteran Poster

This is a question of the server configuration, not a PHP question. Apache servers have to be configured so that PHP files (identified by their extensions) are parsed and executed instead of displayed. You will have to ask your provider to change the server settings accordingly.

smantscheff 265 Veteran Poster

Have a look at the non-greedy query modifyer, the question mark ?.

if(preg_match('/^((.*)">)?(.*?)</',$A[1],$B) == 1)
  die($B[3]);
smantscheff 265 Veteran Poster

You do not have to remove the ' but to escape it. Precede it with a backslash.
See http://php.net/manual/de/function.mysql-real-escape-string.php

smantscheff 265 Veteran Poster

Just put a link in your HTML. If your server is configured properly, it will output a header announcing the file type as Content-type: application/pdf. If the client browser has a pdf plugin activated, it will show the browser in the plugin, otherwise pass it to the operating system which has (hopefully) a PDF viewer installed.

smantscheff 265 Veteran Poster

To the best of my knowledge MySQL does not have macro or eval capabilities. This means that there is no built-in parser which can evaluate a string expression as program code. You will have to supply this parser yourself.

I'd recommend you write a function named "convert" or the like which parses the ToMetrics and ToEnglish field and returns the calculation result.

The alternative is to hard-code the calculation into the query and to keep the ToEnglish and ToMetric fields as reference only, not used in the actual calculation, like you do in your code.

You can actually use the CASE construct directly as a calculated field, much like you did already:

Select 
vitalsigns.DisplayShort,
vitalsigns.ToEnglish,
xrefvitalsigns.Value,
xrefvitalsigns.TypeME,
CASE
WHEN vitalsigns.DisplayShort='Temp' And xrefvitalsigns.TypeMe='M' 
Then ((xrefvitalsigns.Value/0.556)+32)
WHEN  vitalsigns.DisplayShort='WtH' AND xrefvitalsigns.TypeMe='M' 
THEN (xrefvitalsigns.Value*2.2) 	
END AS VALUE
From xrefvitalsigns INNER JOIN vitalsigns 
ON xrefvitalsigns.vitalsignID=vitalsigns.ID;
smantscheff 265 Veteran Poster

Use CSV as intermediate format.

smantscheff 265 Veteran Poster

Show a complete test case with CREATE TABLE statements, INSERT statements and the exact query which you are using.

smantscheff 265 Veteran Poster
SELECT a.SO - b.SO as diff
FROM mytable a, mytable b
WHERE a.ticker=b.ticker 
AND a.date = (SELECT min(date) from mytable c where b.ticker=c.ticker and c.date > b.date)
smantscheff 265 Veteran Poster

Many people tend to store pictures as external files and keep only a reference in the database.
I'd rather recommend to storing them in the database in blob fields as you won't have to deal with file or directory names, updating image files and the like.
The process for that is:
Upload the file and read it from the local temporary into the database.
Create a PHP script which outputs the image field content to the browser. Include a matching image header into the script (e.g. header("Content-type: image/jpeg").
When generating the HTML with images in it, create references to your image display script instead of references to image file names.

// ardav beat me by 2 minutes ;-(

smantscheff 265 Veteran Poster

Use a view which shows your calculated column in real-time instead of calculating it beforehand. If you cannot do this (maybe for performance reasons) use a BEFORE INSERT and BEFORE UPDATE trigger which calculates the difference field.

smantscheff 265 Veteran Poster

No. You have to use comparison operators on table pairs.

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'
smantscheff 265 Veteran Poster

I do not see any references to safe mode - neither in DirectoryIterator nor in the Dir class. Therefore I suggest that you try the Dir class.

smantscheff 265 Veteran Poster

This here is a MySQL forum.

smantscheff 265 Veteran Poster

What the hell do you mean with "doesn't work" ?

smantscheff 265 Veteran Poster

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:

SELECT * FROM publisher where name like "%a%";

To use aggregate functions like sum() or avg() you need an GROUP BY aggregate clause:

select name, max(profit), min(profit) from publisher GROUP BY name;

To find which publisher has the maximum profit, use

SELECT name from publisher order by profit desc limit 1;
smantscheff 265 Veteran Poster
smantscheff 265 Veteran Poster

Please mark this thread as solved.

smantscheff 265 Veteran Poster

If propertylisting_details.php?recordID=nnn works, but your generated links do not, there must be an error in generating them. How does the HTML source code of these links look in the generated page?

smantscheff 265 Veteran Poster

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. Change your query to

mysql_query('CREATE table praveen' . $_POST['id'] . '(id int, amount varchar(10), DTMY text(30))');

}

smantscheff 265 Veteran Poster

What exactly is your problem?
Does propertylisting_details.php?recordID=nnn work? (Replace nnn with any valid record number.)
Does $row_rs_search contain a value?
Show the code in propertylisting_details.php where you query the database.

smantscheff 265 Veteran Poster

Include the <div>... pattern into the search pattern and replace it by itself.

<?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", '$2<a href="$4" target="_blank">$5</a>$6', $message);
echo $message;
?>
smantscheff 265 Veteran Poster

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

smantscheff 265 Veteran Poster

I don't know the framework you are using. What is it?
The PHP manual does not say that the dir class is not functional in safe mode. Try to use this class instead of your directory iterator.

smantscheff 265 Veteran Poster

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

smantscheff 265 Veteran Poster

You are selecting the sum instead of the average.
Try this instead:

SELECT m.movie_id, movie_title, movie_release_year, movie_genre, movie_plot, 
SUM(movie_rate) AS sum_movie_rate, 
AVG(movie_rate) as average_rating 
FROM movie m, user_movie_rate r 
WHERE m.movie_id = r.movie_id and m.movie_id=?
smantscheff 265 Veteran Poster

Please mark this thread as solved.

smantscheff 265 Veteran Poster

Each checkbox needs a unique name by which it is identified in the $_POST array. If all checkboxes have the name "checkbox", you will only get the value of one of them.

smantscheff 265 Veteran Poster

Please mark this thread as solved.

smantscheff 265 Veteran Poster

Replace = by == in your comparison statements.

smantscheff 265 Veteran Poster

Don't post irrelevant code.
Try to pinpoint your problem.
Replace all include() by require_once().
// ardav, you out there? I was here already...

if($problem == "solved"){
  clickLink("mark_as_solved");
}
smantscheff 265 Veteran Poster

So what?

diafol commented: fair comment +8
smantscheff 265 Veteran Poster

Hire a programmer.

smantscheff 265 Veteran Poster

//if accept is pressed
if ($_POST == 'Accept') {
//do this...
}
//else if reject is pressed
if ($_POST == 'Reject') {
//do this...
}

if($problem == "solved"){
  clickLink("mark_as_solved");
}
thunderbird22 commented: great and works perfect +0
smantscheff 265 Veteran Poster

Include that in the sum expression:
Sum(ua * (if(ttc In ('X','Y','C'),-1,1)) * if(Reverse = 'Y',-1,1)) as Total_UA

smantscheff 265 Veteran Poster

But there are reverse transactions (noted in a separate field) that needs to be taken into consideration within that calculation. If there's any suggestions how I can include this, I'd appreciate anyone's help.

I assume you are referring to financial transactions, not to database transactions. What are they, what is the separate field you are talking about, how do they have to be taken into consideration?

You can simplify and maybe accelerate your query like this:

Select A.dc,A.rc,A.acctno,
Sum(ua * (if(ttc In ('X','Y','C'),-1,1))) as Total_UA,C.Total_CUB From Table_A As A 
Join table_B B on a.acctno=b.acctno
Join (Select acctno,
	Sum(cub) As Total_CUB 
	From Table_C 
	Group By acctno 
) As C On A.acctno = C.acctno 
Group By A.acctno Having Abs(Total_UA - C.Total_CUB) > 0.0001
;

or even shorter

Select A.dc,A.rc,A.acctno,
Sum(ua * (if(ttc In ('X','Y','C'),-1,1))) as Total_UA,
(select sum(cub) from table_c C where c.acctno=a.acctno) as Total_CUB 
From Table_A As A 
Join table_B B on a.acctno=b.acctno
Group By A.acctno Having Abs(Total_UA - Total_CUB) > 0.0001
;
smantscheff 265 Veteran Poster

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 from PHP instead of coding numerous error-prone repetitions.