802 Posted Topics
Re: Take a beginner's course in PHP/MySQL. There are plenty out there. | |
Re: You'll have to subscribe to a professional market data service to get quotes without delays. I've searched extensively and not found a single free source. | |
Re: All reserved keywords of mysql are derived from english words. Therefore you are better off not using english words for table and column names to avoid conflicts. Make sure that all components involved - database, tables, columns, server, clients etc. - use an appropriate character set, presumably utf8. Check the … | |
Re: Assuming that you use an Apache server, the best you can do for increased capacity is to increase the RAM. | |
Re: What is your aim? If you want to convert some old flat file to MySQL without disturbing much of your application, just export it to CSV and import it into the new table. If you want to have a clean relational setup, go by the book: eliminate functional dependencies in … | |
Re: How do you match existing client entries with existing folders? If all folders have the same name, you can do it like that (basically an inverted left join): [CODE]insert into folders (foldername, client_id) select 'ClientDocs', client_id from clients where not (client_id in (select client_id from clients,folders where clients.client_id=folders.client_id)) [/CODE] | |
![]() | Re: [CODE]if (mysql_num_rows($sql>0));{ [/CODE]should read [CODE]if (mysql_num_rows($sql)>0);{[/CODE] |
Re: You can do it all in one query and put the display logic into your program code. Make sure that the fields on which the tables are linked are indexed. Also make sure that you select only the needed fields. [CODE]select t1.a,t1.b, t2.c,t2.d, t3.e, t3.f from tbl_level1_p t1, tbl_level2_p t2, … | |
Re: I don't understand the problem. You know how you can get column names using mysql_field_name(). You also know how to get the field content using mysql_result. Put both together to create any array you want. For example (not tested): [CODE]for ($i = 0; $i < mysql_num_fields($result); $i++) $columnNames[] = mysql_field_name($result, … | |
Re: Without looking to deeply into this, first fix the condition [CODE] grade = 'F' or null [/CODE]It should read [CODE] grade = 'F' or[COLOR="Red"] grade is [/COLOR]null [/CODE] | |
Re: What do you mean with "partially upload"? Does part of them get into the database? Show the receiving script and the CREATE TABLE statements for the images table. ![]() | |
Re: [CODE]select city, sum(rewards) from user, rewards where city.userid=rewards.userid group by city; [/CODE] They call it a join. Read about it, you need it everywhere in databases. | |
Re: Is this a question of speed, readability, maintainability or what? You can do it either way as long as you are happy with it. There is no standard way because your database design is flawed. Since placements for the same url are unique (you cannot have sideadmiddle more than once … | |
Re: It is not clear which part you want eventually to match. Do you want to replace css classes? The first three preg_match statements are better put in one single statement to clarify the code. But first tell us which part you want to have extracted. | |
Re: You're welcome. But what do you need? Can't you do the math? | |
Re: Precede p_id by the table and the database name: [CODE]where db1.t1.p_id=db2.t2.p_id and db1.t1.p_id=db3.t3.p_id[/CODE] | |
Re: You can use the group_concat() function: [CODE]SELECT code, COUNT( code ), group_concat(data) AS no_of_times FROM testing_table GROUP BY code ORDER BY code [/CODE] | |
Re: Is date a character or a date field? In the latter case you could use a query like [CODE]select * from mytable sort by date desc;[/CODE] In the former case you have to convert the date field with an inline function. | |
Re: What is your problem? Where are you stuck? | |
Re: Regular expressions do not work recursively. To match arbitrarily deeply nested div tags you would need such an recursion. You could use a regex for this special case like this: [CODE] preg_match_all('~<div class='name'>\s*(<div.*?</div>\s*)?(.*?)</div>~is', $res, $matches );[/CODE] | |
Re: For god's sake, where is the problem? (Did you notice that this here is a PHP forum, not for JavaScript? And did you notice that you are not only allowed, but supposed to use code tags?) | |
Re: You sure have a unique id field in the modul table which you could use to form an anchor, like in [ICODE]<a href="#tabs-$result['id']">$result['nama_modul']</a>[/ICODE] Apart from that, the php code tags are missing in line 9. | |
Re: Where is the problem? You dynamic PHP page displays the database content. When the user submits new stats, store it to the database first place in your script. Then load the data from the database and display the current database content - including the newly submitted data - in the … | |
Re: You have the customer_id. This is link enough. You can select all repairs for one customer using the customer id, and for formatting purposes you can use the group_concat() function, like in [CODE]select group_concat(repair_id) from repairs where customer_id=$fixed_value; [/CODE] | |
Re: Find a free or paid SMS service. They will have usually HTTP GET interfaces so that you can build a HTTP query string which contains your user's phonenumber and payload. | |
Re: Compare the filetimes, then format the one you want to have. [CODE]$format = 'm/d/Y H:i:s'; if ($t1 = filemtime('page1.php') < ($t2 = filemtime('page2.php')) $filetime = date( $format, $t2 ); else $filetime = date( $format, $t1 ); [/CODE] | |
Re: It is a question of code efficiency. You use functions 1) to avoid code repetitions and 2) to make the semantics clearer. If the function is only called one during initialization and you will not use the result at another place, don't store it in a property. If on the … | |
Re: Extract the content you want using regular expressions and store it in a (MySQL) database. You can do that with PHP or any other language with a regular expression module. | |
Re: [CODE]SELECT CustomerName FROM Customer WHERE NOT (Customer.CustomerCode in (SELECT c.CustomerCode FROM Customer c, Movie m, Video v WHERE c.CustomerCode = v.CustomerSoldTo AND m.MovieCode = v.MovieCode AND m.Rating = 'R' ))[/CODE] | |
Re: You can include aggregate functions for the stores in you Group subquery. [CODE]SELECT tblpolicies.PolicyNumber , tblpolicies.StoreId , tblpolicies.ConsultantFullName , tblpolicies.DateReceived , tblpolicies.ClientFullName , tblpolicies.Comment , tblpolicies.Query , tblpolicies.PolicyStatus , tblpolicies.DateModified , Groups.GroupName , Groups.StoreName , Groups.StoreTarget , Groups.StoreManager , Groups.PortfolioName , Groups.StoreStatus , Groups.RepName , Groups.ProvinceName [COLOR="Red"] , Groups.NumberOfPolicies [/COLOR] … | |
![]() | Re: You can check the HTTP_POST_FILES array for the actual file size and gracefully reject larger files. There is also a PHP setting max_upload_size which can limit the upload size with a maybe not so user-friendly error message. The uploaded file can be converted with the GD image library. Or install … |
Re: I cannot resist ardav's challenge for a 2-liner. This is not a 2-liner, but at least it has 2 lines less than ardav's solution (which is a fine start to begin with). Just add 4 weeks to your start date. If this does not bring you into the next month, … | |
Re: What does $View contain in your query? In these lines the replacement [ICODE]', '[/ICODE] by [ICODE]','[/ICODE] can never occur because all blanks have already been replaced before. [CODE]$replace_what = array(' ', ' - ', ' ', ', ', ','); $replace_with = array(' ', '-', '_', ',', '-');[/CODE] | |
Re: If you are using PHP, you can use exactly the same DDL statements as from the command line. So, yes, you can dynamically create and alter tables. | |
Re: You got your quotes wrong. Change [CODE] $query = "SELECT * FROM players WHERE UID='$uid'; [/CODE]to [CODE] $query = "SELECT * FROM players WHERE UID='$uid'";[/CODE] And use a decent editor with syntax highlighting. I recommend EditPad++. | |
Re: Start with a clean database design which does not contain structural duplicates. You do not need one table for each quiz, but one table each for quizzes, questions, answers, users, users_and_answers. First do all your database work and see if you store and retrieve all necessary info. Then move on … | |
Re: How far have you got already? Show your code. | |
Re: Use array_merge(). [CODE]$variable3 = array_merge( $variable1, $variable2 ); [/CODE] And check your code style. With your kind of ungrammatical writing and spelling you will spend more time debugging than coding. | |
Re: You already have an AFTER UPDATE trigger ON takes in your database. | |
Re: So what? In which ecospace is this problem at home? Do you want to solve it interactively, or in a trigger, or in PHP script, or by means of smoke signals? | |
Re: You can protect the phpmyadmin directory with an .htaccess containing the statements AuthType Basic AuthName "Restricted Files" AuthUserFile path/to/your/password/file Require user /your/username Have a look: [url]http://httpd.apache.org/docs/2.0/howto/auth.html[/url] In the phpmyadmin is an index.php file to which the empty request / defaults. | |
Re: My first suggestion is that you explain your problem. What do you want? | |
| |
Re: Show the code. Are you updating the database at all? | |
Re: Use backticks for column names instead of apostrophes (or omit them if your column names don't contain blanks), but use apostrophes around the field content. Do not use a semicolon inside the statement if you submit it using PHP. [CODE]$sql = "INSERT INTO `comments` (user ,pass,comment) VALUES ('$user', '$pass', '$comment')";[/CODE] | |
Re: If you were my fellow programmer you would use code tags for better readability. And you would boil down your code to the problem without having us to spell our way through lots of irrelevant HTML. Be a good fellow and try again. |
The End.