1,741 Posted Topics

Member Avatar for StePu

Here is an example. [code] <html> <body> <ul> <?php for($i=65;$i<=90;$i++) { echo "<li><a href='char.php?alpha=".chr($i)."'>".chr($i)."</a></li>"; } ?> </ul> </body> </html> <?php if(isset($_REQUEST['alpha'])) { $alphabet = $_REQUEST['alpha']; echo "You selected alphabet: ".$alphabet; /* * Then you can query the table for fonts starting from the selected alphabet like * $query = "select …

Member Avatar for StePu
0
130
Member Avatar for mrjoli021

Technically, it doesn't matter if you have only 1 line statement after a condition. ie., [code] <?php $x = 1; if($x == 1) echo "$x is valid."; else echo "$x is invalid"; ?> [/code] This will not work if you have more than 2 statements in your condition. Btw, its …

Member Avatar for leviathan185
-1
118
Member Avatar for jck6288

[quote] Do not post homework problems expecting a quick answer without showing any effort yourself. [/quote] Seems like you didn't read the [url=http://www.daniweb.com/forums/faq.php?faq=daniweb_policies]member rules.[/url] Ch, ch. Read more on count and group by clauses. After reading them, you will be able to solve this query yourself. :) Good luck.

Member Avatar for nav33n
-2
98
Member Avatar for rajeesh_rsn

Very simple. [code] <html> <head> <script type="text/javascript"> function checkCheckbox() { var countselection = 0; var maximumselection = 2; var ch = document.getElementsByName('choice'); for(i=0;i< ch.length;i++) { if (ch[i].checked) { countselection++; } } for(i=0; i < ch.length;i++) { if (!ch[i].checked) { if(countselection == maximumselection) { ch[i].disabled=true; } else { ch[i].disabled=false; } } …

Member Avatar for rajeesh_rsn
0
103
Member Avatar for Aamit

I didn't go through so many functions in your script, but it works. You are supposed to select the options from the 2nd list before submitting. Unless you select them, they are not selected by default.

Member Avatar for nav33n
0
91
Member Avatar for ShaunPasko
Member Avatar for veledrom

ob_start, as it indicates, will start output buffering. If you are using ob_start, then you should also use ob_end_flush, ie., flushing the output buffer. I have used ob_start at places when I had already echo-ed something [which was unavoidable at that time] before starting the session or calling the header …

Member Avatar for veledrom
0
248
Member Avatar for ruwanaru

Not only echo, you will get this warning if you have session_start along with header function. Use [code] ob_start(); [/code] as the first line of your script to turn on output buffering and [code]ob_end_flush(); [/code] as the last line to flush the output to the buffer.

Member Avatar for venkat0904
0
116
Member Avatar for feddie1984

[QUOTE=leviathan185;1050970]you could also make a function out of it [CODE=php] <?php function arrayToString($array) { $string = ''; foreach($array as $value) { $string .= "{$string}, {$value} "; } return $string; } echo arrayToString($_POST['Prefered_Engineers']); ?> [/CODE][/QUOTE] Or simply, [code]$string = implode(",",$_POST['Prefered_Engineers']); [/code]

Member Avatar for feddie1984
0
153
Member Avatar for whitestream6

To get a new line, you should add a <br /> to your echo. ie., [code] <?php echo $abbr['US']['MI']."<br />"; ?> //or simply <?php echo $abbr['US']['MI']; echo "<br />"; ?> [/code] [quote] Also, can you use the php include function in arrays like I used the HTML image function in …

Member Avatar for nav33n
1
192
Member Avatar for ym_chaitu

:) You forgot the column name as the 2nd parameter for mysql_result. [url]http://php.net/manual/en/function.mysql-result.php[/url]

Member Avatar for nav33n
0
88
Member Avatar for cakka

:( No. I pay around Rs. 1200 (approx $26) for my 512kbps connection. Its around Rs. 3000 for 1 mbps (that is approx $65).

Member Avatar for zortec
0
332
Member Avatar for levsha

You are supposed to put mysql_fetch_array in a while loop. [code] while( $data2 = mysql_fetch_array($query)) { echo $data2['firstname']; echo $data2['lastname']; echo $data2['task']; } [/code]

Member Avatar for levsha
0
113
Member Avatar for Jupiter 2
Member Avatar for veledrom

I don't recommend using mysql_fetch_row though. This will return an array with numeric indices and the script will fail if you add a new column to your table. I personally prefer using mysql_fetch_assoc . You can also use [icode] mysql_fetch_array($result,mysql_assoc) [/icode] to get the records based on its associative names.

Member Avatar for network18
0
95
Member Avatar for iraberyl

[QUOTE=network18;1049921] also do we need to use the exit() below it?Will it ever get executed when already redirected to the header-location page?No it will get its turn to execute.[/QUOTE] The exit function is used as a safety measure just in case the end user gets to echo something before header …

Member Avatar for iraberyl
0
153
Member Avatar for Muazam

There are still some typos. $GET_['formfield'] instead of $_GET['formfield']. One simple suggestion though. You don't need a switch/if-elseif-else condition to find out the day. A simple array will do it. This is what I am talking about. [code=php] <?php //nodag = Norwegian day //endag = English Day // dag = …

Member Avatar for network18
0
151
Member Avatar for GrimJack

[QUOTE=cwarn23;1049867]Looks like a bunch of ones and zeros with a few letters to me.[/QUOTE] No, see the 3rd image. From the website: [quote] This is an animation of the clock that shows in "fast forward" how it in twelve hours goes around. [/quote] Quite an effort !

Member Avatar for nav33n
1
286
Member Avatar for iraberyl

Do as above. But, If you are a novice user and you find it hard to use ajax, then you can do the traditional way. Submit the form having an onchange event on all the dropdowns. When you select, say milk, from the first dropdown, submit the form, so $_REQUEST['firstdropdown'] …

Member Avatar for iraberyl
0
79
Member Avatar for Kadjii

I hope this is what you are looking for. [url]http://www.i-marco.nl/weblog/archive/2007/06/14/variable_variables_in_javascri[/url]

Member Avatar for Airshow
0
136
Member Avatar for ady_1

Have onsubmit event for form. Here is ane example. [code] <?php if(isset($_REQUEST['submit'])) { print "<pre>"; print_r($_REQUEST); print "</pre>"; } ?> <html> <head> <script type='text/javascript'> function validate(form) { if(form.name.value == "") { alert("Name cannot be empty"); return false; } return true; } </script> </head> <body> <form method='post' onSubmit='javascript: return validate(this);'> Name: …

Member Avatar for Alxandr
0
121
Member Avatar for futhonguy

[QUOTE=leviathan185;1044621]It could be that you are using single quotes around the values that are meant to be integers, the single quotes are converting them to strings. [/QUOTE] You are almost right. Since its a function, there is no need for single quotes for mysql_insert_id. Secondly, Even integers can have single …

Member Avatar for futhonguy
0
189
Member Avatar for Carcinosi

Hi, If I understand your question right, this should do the trick. [code] select * from customers c, cust_packages cp where c.cust_custnr = cp.cpack_usernr group by cpack_usernr having count( * ) =1 and cpack_canceldate != '0000-00-00' [/code] This will select all the customers with only 1 record in table cust_packages …

Member Avatar for nav33n
0
129
Member Avatar for futhonguy

One suggestion. When you are inserting a record to the table, you don't have to insert 'NULL' if its an auto increment field. Mysql will do it for you. Ie., [code] $orange_insert = "INSERT INTO orange (orange_name, orange_add) VALUES ('$val_name', '$val_add')"; [/code] Secondly, the 'error' you are getting is not …

Member Avatar for futhonguy
0
151
Member Avatar for cwarn23

How about a tutorial on pagination (this question has been asked n number of times) , carts, htaccess, image handling, regular expressions, ...

Member Avatar for cwarn23
4
648
Member Avatar for jen140

Hi, can you elaborate your question ? If you are inserting the value to the table from php, you can use [url=http://php.net/manual/en/function.substr.php] substr [/url] to insert only a part of a string. If you are directly inserting the record to the table, you can use mysql's [url=http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_substr] substring [/url] function. …

Member Avatar for nav33n
0
174
Member Avatar for jakx12

Hi, I am not sure how you are validating what mysql returns. In php, when you query the table, for example, [code] //query the table with username and password $query = "select * from table where username='test' and password='test'"; //execute the query and save the resource in $result. $result = …

Member Avatar for nav33n
0
146
Member Avatar for whiteyoh

[url]http://www.tizag.com/mysqlTutorial/mysqlfetcharray.php[/url] You should use the array returned by mysql_fetch_array and not the result resource itself. ie., $row['content'], $row['name'] etc and not $result['title'] !

Member Avatar for saranya14
0
6K
Member Avatar for zandiago

If the kid's behaviour is like Dennis (the menace), then he should be punished. And when i say "he should be punished", i dont mean physical abuse. Physical abuse is bad. And hey, fiery look and a lil yelling can be useful sometimes ! :D

Member Avatar for BestJewSinceJC
0
888
Member Avatar for trahrey

[QUOTE=trahrey;1023430]i looked at your message you didn't show me any direction[/QUOTE] Okay! Here is the direction. From this point [b]>> * <<[/b] Go straight up and stop when you see the text "Software Development". Since you have already traveled this far, you might be tired and maybe you need a …

Member Avatar for sneekula
-5
227
Member Avatar for itsense

As I mentioned in another thread, have another variable array in the for loop, say, $cost_array. Assign the same value to it. Then do array_sum($cost_array). That will give you the sum of $cost.

Member Avatar for hanna aizawa
0
106
Member Avatar for alxwm
Member Avatar for sumain

[QUOTE=sumain;863988]Hi All, Hope all are fine. I need some help, that is i want to show email address after provides the username and password. it will happen in my personal site.[/QUOTE] :) You should have started a new thread and mentioned your problem in detail (providing relative code). But anyway, …

Member Avatar for diafol
0
160
Member Avatar for rich69
Member Avatar for omoabobade
-1
357
Member Avatar for jephthah

:icon_rolleyes: Can't wait to see that golden shiny star ? eh ? Edit: Oh wait, You just got it!

Member Avatar for Wasser
0
161
Member Avatar for nav33n

Hi all, I have a suggestion (not sure if it has already been discussed). In the profile, at the community tab, we have, for example, [quote] Code Snippets: 10 [/quote] If this number [i]10[/i] is made a href linking to all the code snippets posted by that particular user, it …

Member Avatar for nav33n
6
313
Member Avatar for Dani

[QUOTE=crunchie;1005998] EDIT. That's weird. Now I have zero negative :-O[/QUOTE] Its fine! I changed it to +1 when I saw your comment :D [QUOTE=crunchie;1005979]Not sure if I like it. I got 3 negative votes for posts where I posted help :([/QUOTE] (and those 3 posts didn't deserve a negative vote!)

Member Avatar for happygeek
4
534
Member Avatar for nav33n
Member Avatar for peter_budo

Hmm.. Right.. [url=http://www.daniweb.com/newsletter/] This[/url] link is missing!

Member Avatar for peter_budo
3
213
Member Avatar for emhmk1

You are almost there! I have modified your code, very small changes. [code=php] <?php if(isset($_POST['submit'])) { for($i=1;$i<=$_POST['count'];$i++) { $textfieldname = "marquee_".$i; print $_POST[$textfieldname]; print "<br />"; } } ?> <html> <head> <script language="javascript" type="text/javascript"> function addField() { var tbody = document.getElementById("tblBody"); var ctr = tbody.getElementsByTagName("input").length + 1; var input; if …

Member Avatar for emhmk1
0
101
Member Avatar for kira4

Notices are not errors. If you try to use a variable without initializing it, you will get a notice. To disable notices, edit your php.ini and set error_reporting as, [quote] error_reporting = E_ALL & ~E_NOTICE [/quote] This will show all the errors except notices. But, if you want fix these …

Member Avatar for nav33n
-1
140
Member Avatar for madhav089

[url]http://dev.mysql.com/doc/refman/5.1/en/innodb-foreign-key-constraints.html[/url] Check for [i] foreign key constraints, primary key, foreign key [/i] in google. [quote] From the above link: InnoDB rejects any INSERT or UPDATE operation that attempts to create a foreign key value in a child table if there is no a matching candidate key value in the parent …

Member Avatar for madhav089
0
169
Member Avatar for jrosh

[quote] I want to fill that third column(duration) when I insert the values to the first 2 columns.. [/quote] Why don't you calculate the difference between starttime and endtime and insert the difference while inserting values to the first 2 columns ? I haven't used triggers myself, but I think …

Member Avatar for peter_budo
0
127
Member Avatar for nav33n

:icon_eek: Strange things have been happening lately. 1. Visited threads are still marked as unread ? 2. Even though I made the last post in [url=http://www.daniweb.com/forums/thread228062.html] this [/url] thread, [url=http://www.daniweb.com/forums/forum17.html] php forum [/url] doesn't say so. I have attached the screenshots of the forum and the thread. One more bug. …

Member Avatar for Dani
0
420
Member Avatar for nav33n
Member Avatar for smvec

Also, try sending a simple mail to see if it works. [code=php] <?php mail("[email protected]","test","test mail ! Hope it works","from: [email protected]"); ?> [/code] If it does, then its obvious that you missed out something in your other script.

Member Avatar for network18
0
103
Member Avatar for virtualmisc

I have used zend studio, aptana, php Designer, eclipse, netbeans, maguma studio, dev php, editplus, etc. Among all these, I liked zend studio 5.5 more. The later versions, 6 and 7 had a lot of bugs when I last used it (like irregular brace mismatching, delayed code suggest (in ver7), …

Member Avatar for redhouse
-1
206
Member Avatar for ultras

Try this. [code=php] $query = "select * from table where Concat( column1, ' ', column2 ) LIKE '%".$search."%'"; [/code] This will return all the rows from the table where column1 concatenated with column2 matches $search. eg. [code=php] SELECT * FROM master_table WHERE Concat( firstname, ' ', lastname ) LIKE '%alli …

Member Avatar for nav33n
0
128
Member Avatar for SKANK!!!!!

[QUOTE=SKANK!!!!!;1003629]how do i select a row in a table columns i dont know the name of(and find the name of it)? but i know the cell/field of the column has a value of "55" i also have to EXCLUDE ONE COLUMN that i know the name of. does anyone know …

Member Avatar for SKANK!!!!!
0
165
Member Avatar for jithusdani

Instead of storing the password just like a normal string, save it as an encrypted string, using SHA1 or something. This will provide you more security as well as solves your issue. Here is an example to clarify any further doubt. [code=php] <?php echo SHA1("ABC"); echo "<br />"; echo SHA1("abc"); …

Member Avatar for Atli
0
173

The End.