802 Posted Topics

Member Avatar for chemngng
Member Avatar for chemngng
0
317
Member Avatar for jrotunda85

Use preg_replace() to match and format the values supplied by users. Strip the phone numbers of any non-numeric characters first. Apply [CODE]$number = preg_replace( '/[^0-9]/', '', $number ); $number = preg_replace( '/([0-9]{3})([0-9]{3})([0-9]{4})/', '($1) $2-$3', $number ); [/CODE] Likewise for the domain.

Member Avatar for diafol
0
310
Member Avatar for mmlmitchell

If you submit your data in the form of a test case - that is as MySQL statements which can directly entered into the mysql command line interface reproducing your problem, as in my post [url]http://www.daniweb.com/forums/post1492091.html#post1492091[/url] - I'm willing to give it a try.

Member Avatar for urtrivedi
0
152
Member Avatar for klemme
Member Avatar for Fresco Vivir

There are numerous ways. For example, you can use the mysql_field_name() function. Or you can alter your script. In the loop, do [CODE]foreach($show as $key => $value) echo "$key: $value\t"; echo "\n"; [/CODE]

Member Avatar for Fresco Vivir
0
164
Member Avatar for BleepyE

It's not us who are confused ;-) You can put your php script to sleep for one day (see the sleep function) and let it run unterminated. Or you can use PHP from the command line as a script language and call it from a cronjob. I'd recommend you use …

Member Avatar for BleepyE
0
132
Member Avatar for shelexelex
Member Avatar for comondx

Replace [ICODE]name="date"[/ICODE] by [ICODE]name="date[]"[/ICODE]. Then in send.php walk through the array [ICODE]$_POST['date'][/ICODE] and generate an INSERT query for each element.

Member Avatar for smantscheff
0
157
Member Avatar for bristolspider

echo yor $query to see if it contains the expected content. If it does, run in from the mysql command line.

Member Avatar for smantscheff
0
70
Member Avatar for klemme

0) Your select box has several HTML errors: [ICODE]name=linklabel=''[/ICODE] should probably read [ICODE]name='linklabel'[/ICODE] Put quotes around all attribute values in HTML. 1) Use the onclick event in JavaScript: [ICODE]<select onclick='document.test.submit()'...> [/ICODE] or something like that - I don't know the necessary javascript by heart. 2) In edit_page.php you get the …

Member Avatar for smantscheff
0
134
Member Avatar for ZPBSFG

It is possible, but it's not a mysql or database problem. The database part is peanuts. The time consuming part is analyzing the target site's interfaces. Many of such sites have provisions against automated usage which would have to be overcome. So if your developers are stuck it's probably this …

Member Avatar for smantscheff
0
283
Member Avatar for tape enterprise

I assume that with "row names" you mean the column names. You can get them with the functions mysql_field_name and mysql_field_count: [CODE]while ($object = mysql_fetch_object($result) { for ($i = 0; $i < mysql_field_count($result); $i++) { $field_name = mysql_field_name($result, $i); $field = $object->$field_name; ... } }[/CODE]

Member Avatar for diafol
0
90
Member Avatar for dev.vini

Use preg_match_all() [CODE]if (preg_match_all( '/A ([0-9]+)/', $paragraph, $matches, PREG_SET_ORDER )){ foreach( $matches as $m ) ... // process $m[1] } } [/CODE]

Member Avatar for smantscheff
0
59
Member Avatar for mmlmitchell

[CODE]select sum(c.pop) from (SELECT pop FROM wi_allbcdata b WHERE b.countyname='Adams' GROUP BY blkidfp00) c;[/CODE]

Member Avatar for smantscheff
0
641
Member Avatar for erdemece

Study regular expressions. You can achieve your goal with the preg_replace() function which can find well-formed links and replace them with the appropriate HTML code.

Member Avatar for smantscheff
0
188
Member Avatar for Coyx

Without having understood the details of your problem, I see that it cannot work: your LEFT JOIN clause does not contain any comparison: [CODE]FROM prod_contacts.cms_contacts LEFT JOIN prod_contacts.cms_table_packholder ON cms_contacts.packholder [/CODE]should probably read [CODE]FROM prod_contacts LEFT JOIN cms_contacts ON cms_contacts.packholder = prod_contacts.packholder[/CODE]

Member Avatar for Coyx
0
210
Member Avatar for kolibrizas

First I recommend that you test your variants for speed and efficiency. Then have a look at the EXPLAIN explanations for your update queries which might tell you about some potential inefficencies. Third, I assume you have an unique user/products index. Therefore you could use an INSERT IGNORE query to …

Member Avatar for smantscheff
0
142
Member Avatar for MoreBloodWine

When you remove the RewriteRule from .htaccess, you are seeing the .jpg file. If the rule is active, you see the output of the PHP file which is something completely different. You do not need this setup. Instead replace all references to the .jpg file by references to the .php …

Member Avatar for smantscheff
0
276
Member Avatar for anirban1087

1. Add a field "size" to the product table and add a lookup table "sizes" for this field. 2. The standard layout is one table for the invoice and one table for the invoice positions (items) which are linked to the invoice table.

Member Avatar for anirban1087
0
134
Member Avatar for codemonkey88

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

Member Avatar for codemonkey88
0
114
Member Avatar for Blaine Tuisee

[CODE]select a.form_num, a.name, b.score, b.ddate from form1 a, form2 b where a.from_num=b.form_num order by b.ddate limit 1; [/CODE] or [CODE]select a.form_num, a.name, b.score, b.ddate from form1 a, form2 b where a.form_num=b.form_num and b.ddate = (select min(ddate) from form2 where form_num=a.form_num) c; [/CODE]

Member Avatar for smantscheff
0
173
Member Avatar for jrhitokiri

Also have a look at the preg functions of PHP which might be much easier to handle than the external grep.

Member Avatar for jrhitokiri
0
2K
Member Avatar for sayakyi

Your code has one superfluous loop which you did not notice because of a second error. [ICODE]<? $db_name="mydb"; trim($searchterm); if (!$_GET["searchterm"]) { echo "You haven't entered any word to search.Please, go back and entered it."; exit; } $searchterm = addslashes($searchterm); require("dict.php"); if (!$db) { echo "Error. Can't connect to database.Please …

Member Avatar for sayakyi
0
269
Member Avatar for klemme

You do not get a PHP error, but a notice. To avoid it, change [CODE]$act = $_GET['act']; //retrives the page action[/CODE] to [CODE]if (isset($_GET['act'])) $act = $_GET['act']; //retrieves the page action[/CODE] I am not sure if the PHP error notice appears before the header is sent to the browser. If …

Member Avatar for klemme
0
221
Member Avatar for Ignatius88

You are selecting the sum instead of the average. Try this instead: [CODE]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=? [/CODE]

Member Avatar for smantscheff
0
138
Member Avatar for oree

Replace "Replay" by "Reply". Replace "\n" by "\r\n". Add a "\r\n" to the first header to separate it from the second. [CODE]$headers = "From: mywebsite.ca\r\nReply-To: Do Not Reply\r\nX-Mailer: PHP/" . phpversion(); $headers .= "\r\nContent-type: text/html; charset=iso-8859-1"; [/CODE] Then try again.

Member Avatar for oree
0
152
Member Avatar for ruchit

There is a lot wrong with this code. Another question is why it is not working as expected. I assume because your pictures are in the pic subdirectory and you are applying the filesize function to a non-existent file in the root directory. Try [CODE]print(filesize("/pic/" . $dirArray[$index])); [/CODE]

Member Avatar for smantscheff
0
75
Member Avatar for raghujosh
Member Avatar for raghujosh
0
1K
Member Avatar for gazzy1

Send your users to a script which evaluates the user id and sends a Location: header back to the desired page. But are 01.php and 02.php really substantially different? Would you not be better off with only one script and variable content depending on the user?

Member Avatar for smantscheff
0
87
Member Avatar for anirban1087

I suggest you use something like pritaeas' expression in a BEFORE INSERT trigger and store it in a invoice_number field. Instead of using the count(*) function I'd rather check for the highest number in this month and store it in a separate field. In your trigger BEFORE INSERT: [CODE]SET new.invoice_number …

Member Avatar for anirban1087
0
95
Member Avatar for pritesh2010

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 …

Member Avatar for smantscheff
0
656
Member Avatar for Joe34

Have a look at the non-greedy query modifyer, the question mark ?. [CODE]if(preg_match('/^((.*)">)?(.*?)</',$A[1],$B) == 1) die($B[3]); [/CODE]

Member Avatar for smantscheff
0
167
Member Avatar for art_wired

This has nothing to do with Joomla (or with PHP). Just set up a page with four links to four different pages. You can host as much sites and databases on one server as you want.

Member Avatar for smantscheff
0
141
Member Avatar for anirban1087

Still better, put the whole HTML code within PHP tags. It's much easier to read and to maintain. [ICODE]<?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' …

Member Avatar for anirban1087
0
113
Member Avatar for Trilby1992

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';

Member Avatar for smantscheff
0
298
Member Avatar for eoop.org

And you haven't read this: [url]http://www.daniweb.com/forums/thread191031.html[/url]

Member Avatar for jtreminio
0
124
Member Avatar for manish250

You have to convert the array content to string literals. Like in [CODE]SELECT * FROM table WHERE shortcode IN ('a','b','c');[/CODE]

Member Avatar for smantscheff
0
75
Member Avatar for fka

array_unique() keeps the indexes intact. If not specified otherwise, these are ascending integers. Try this instead: [CODE]$pid = array_unique($pids); foreach( $pid as $key => $value ) echo "$key: $value<br/>"; [/CODE]

Member Avatar for smantscheff
0
101
Member Avatar for EricIskhakov

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.

Member Avatar for EricIskhakov
0
106
Member Avatar for veledrom
Member Avatar for smantscheff
0
47
Member Avatar for jacob21

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 …

Member Avatar for smantscheff
0
126
Member Avatar for thijscream

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

Member Avatar for happytogether
0
117
Member Avatar for deolalkar_pooja

If the field may only have four values, use an enum type. [CODE]create table publisher(name varchar(20), city enum('mumbai','pune','nasik','panji'))[/CODE]

Member Avatar for smantscheff
0
98
Member Avatar for redous

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.

Member Avatar for smantscheff
0
113
Member Avatar for JoyBh
Member Avatar for Aser Gado

Maybe you forgot to initialize the session with session_start(). And instead of line 3 it shoud read [CODE] $row = mysql_fetch_row( $r ); [/CODE]

Member Avatar for Aser Gado
0
284
Member Avatar for EricIskhakov

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.

Member Avatar for EricIskhakov
0
248
Member Avatar for ebanbury

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

Member Avatar for ebanbury
0
201
Member Avatar for jrotunda85

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 …

Member Avatar for diafol
0
291
Member Avatar for b89smith

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.

Member Avatar for smantscheff
0
243

The End.