1,257 Posted Topics
Re: YOU Must write follwowing code in delete.php [CODE] if($_GET['cmd']=="delete") { $sql = "DELETE FROM Cars WHERE Id={$_GET['Id']}"; $result = mysql_query($sql); echo "Row deleted!"; } [/CODE] ![]() | |
Re: simply echo word selected with space at line no 9 of your code echo " selected "; //correct DO NOT ASSIGN ANYTHING echo 'selected="selected"' //incorrect | |
Re: To format your date output you may use date_format() function. refer mysql manual for details. | |
Re: create relation in requires table. both column will take value from course table. do not allow casacade update or delete to protect related data from deleting. | |
Re: You have to add one more table to your system say "order_hdr" with columns, order_id, order_date, customer_name, etc..... Here keep order id autoincrement. rename your order table order_dtl table and without autoincrement in order_id, first Insert record in order_hdr table. get order_id generated in some variable now insert products and … | |
Re: after line no 63 type end brace " } " for function, before "?>php" or line 12 if($alphaNumCheck) is without end brace " } " | |
Re: I have changed your line no 51-54 [code] if($_GET['orderbycol']=="") $_GET['orderbycol']="lastname"; $enamn = mysql_query("SELECT * FROM contacts ORDER BY $_GET['orderbycol']"); echo "<table border='1'>"; echo "<tr> <th><a href='{$_SERVER['PHP_SELF']}?orderbycol=lastname'>Efternamn</a> </th> <th><a href='{$_SERVER['PHP_SELF']}?orderbycol=firstname'>Förnamn</a> </th> <th><a href='{$_SERVER['PHP_SELF']}?orderbycol=beskcolname'>Beskrivning</a> </th> <th><a href='{$_SERVER['PHP_SELF']}?orderbycol=telfocolname'>Telefonnummer</a> </th> <th><a href='{$_SERVER['PHP_SELF']}?orderbycol=favcolname'>Favorit?</th></a> </tr>"; [/code] | |
Re: specify what error or unexpected things happening? | |
Re: if you want to use two columns to concat into third column then you may use following query [code] update mytable set col1=concat(col2,col2) where col4='mycondition' [/code] | |
Re: when you use mysql_fetch_array will have number as array key that is 0,1,2,3,....., if you want to access it thourgh field name then you must user mysql_fetch_assoc(); Also I think you need to set an inner loop because second query may give you more than one record. Right now you … | |
Re: <?php echo "<a href=hotel-map.php?id=$pid><img src='myimage.jpg' width='100px' height='75px'></a>"; ?> | |
Re: check whether script source is a web address. May be jquery. then download equivalent js file. ![]() | |
Re: [code] update mytable set crterm=bal/pi where somecolumn='my condition' [/code] | |
Re: where is you loop code and query? also post your sample expected output | |
Re: [code] select min(a.IpAddressDigit +1) free_ip from iptable a left outer join iptable b on b.IpAddressDigit =a.IpAddressDigit +1 where b.IpAddressDigit is null order by a.IpAddressDigit [/code] | |
Re: You need to write script that will query all record whose user set time matches with current server time. Now you can send mail for those recods only. After writing a script, you need to add this script to cron job/schedule task which runs every minute. | |
Re: You just fill up your country database with country code and country name. you will find it very easily. make country code as foreign key. Then give user dropdownlist to select country. dont allow user to type country name. | |
I have some doubt regarding jquery and ajax. What is the difference between jquery and ajax? Do jquery accesses server resource or its just do the things at client side? while solving a problem what to choose out of these two? | |
Re: SELECT * FROM rounds WHERE `round`=`current_round`-1 | |
Re: To join two table you must have pk/fk relation between tables. I am assuming that itemid is link column between two tables. [code] SELECT a.name, a.price,b.somcolname from products a ,discount b WHERE a.itemid=b.itemid and a.itemid = '$id' [/code] | |
Re: select * from db1.table1 a left outer jion db2.table2 b on a.joincolname=b.joincolname | |
Re: group by is used to aggregate you data, you dont need group by so remove group by clause from your query. following is your query [code] SELECT Dname, Dnumber FROM DEPARTMENT [/code] | |
Re: sid data 1 abc 2 def 1 dfsf 2 sdfs suppose above is the case in your table, then what result do you expect? | |
Re: following query will show 100 records and start from record no 20 [code] select * from table1 a where mycol='mycondition' limit 20, 100 [/code] | |
Re: try as given below with @ sign [code] @mysql_connect("localhost", "Master", "pword"); @mysql_select_db("db"); $official2 = @mysql_query("SELECT * FROM Contribute WHERE stack LIKE '%comic%' ORDER BY points DESC")OR die (mysql_error()); [/code] | |
Re: Your code only works option value and text is same. and that to in small case try with following programmer|programmer myself|myself irene|irene You need to modify your javascript function | |
Re: you need to add a cron job on linux and schedule task on windows. ![]() | |
| |
Re: you can build your query as shown below [code] $query= " select * from mytable where company_name in ( '".implode("','",$_POST['flight'])."' )"; [/code] | |
![]() | Re: change line no 5 of second code block to following [code] $att_ref .= $attribute[$i].","; [/code] separte selected codes with comma. Also you are directly assing you must concat to retain previous loop values. |
Re: [code] <?php function sort($arr) { for($i=0;$i<count($arr);$i++) { if($arr[$i]>$arr[$i+1]) { $max=$arr[$i+1]; $arr[$i+1]=$arr[$i]; $arr[$i]=$max; } } return ($arr); } $a[0]=3; $a[1]=4; $a[2]=5; $b[0]=1; $b[1]=3; $b[2]=5; $c[0]=5; $c[1]=3; $c[2]=2; $a=sort($a); $b=sort($b); $c=sort($c); ?> [/code] | |
Re: Some database supports cascade delete, cascade update option. Mysql innodb engine may be supporting this. You need to modify relation between two tables and allow cascade delete. [URL="http://dev.mysql.com/doc/refman/5.1/en/innodb-foreign-key-constraints.html"]click here for details [/URL] | |
Re: [code] <input name="hiddenfield" type=hidden value='somevalue'> [/code] User will not able to view the field but still it will be posted along with other form elements. | |
Re: in your index.php, change line no 14, pass connection resource and then try. $rs=mysql_query($query[B], $con[/B]); | |
Re: which field(s) is link between the two table, and what is the cardinality one-many or many to one between these tables. | |
Re: Print and check whether your page is getting the values properly or not, by keeping following code in the begining of your page. [code] echo "<pre>"; print_r($_GET); echo "</pre>"; [/code] | |
Re: for page authentication I use to do following steps 1) When user loggs in I store permitted page names from database for the user in a session arrary 2) In every page I call permission.php file, which checks requested page ($_SERVER['SCRIPT_URI'] ) is there in page session array set in … | |
Re: use str_to_date() function of mysql [code] $sql = "INSERT INTO submissionfiledata "."(date,Name,FromEmailid,PhoneNumber,CountryName) "."VALUES " . "(str_to_date('{$date}' ,'%M %d %Y') , '$name','$emailid', '$phone','$country')"; [/code] | |
Re: You need to write following code in "BookingForm.php" page. Remove this code from your registration page. Becuase when registration page is opened nothting is posted to it, so blank row is inserted. [code] <?php $con = mysql_connect("localhost","root","password"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("ambos", $con); mysql_query("INSERT … ![]() | |
Re: Where is the query? Anyways following query may help you. Always use table alias before column name when you are querying more than one table. [code] select p.staff_ID , p.title , p.fn , p.ln , t.training_id, t.training_level, t.school_name, t.training_date from personal_details p inner join training t on t.staff_id=p.staff_id [/code] | |
Re: [code] select sum(sub_amt) total_due from ( select sum(amount) sub_amt from product1 where date is null union select sum(amount) sub_amt from product2 where date is null union select sum(amount) sub_amt from product3 where date is null union select sum(amount) sub_amt from product4 where date is null union select sum(amount) sub_amt from … | |
Re: Change line no 163 as given below [code] echo "<td>";echo "<a href='http://localhost/sdc/?q=node/3&CP_ID={$row['CP_ID']}'>";echo $row['CP_ID'];echo "</td>"; [/code] Now in your edit page you will get value of clicked CP_ID in $_REQUEST['CP_ID'] variable. | |
Re: just added , wins*3 points in first line [code] select team, wins, wins*3 points from ( select hometeam team, count(*) wins from fixtures where competitionname = 'prem'and homepoints = '3' group by hometeam union select awayteam team, count(*) wins from fixtures where competitionname = 'prem' and awaypoints = '3' group … | |
Re: use $_SERVER['HTTP_REFERER'] variable to find which page was referred by user before login. In login page above variable will contain the page name from which login is called. so after successfull login check, transfer to url in above variable. | |
Re: set auto index for your new table using following query [code] ALTER TABLE tbl AUTO_INCREMENT = 100; [/code] | |
Re: If you place <br> it will always break your line in browser. If your aim is readablility then why don`t you simply press enter key where ever you want to break your line for your view, instead of typing <br>? | |
Re: [code] SELECT f.forumname,f.forumdesc,count(*) as total_topics from Forum as f INNER JOIN Topic as t WHERE f.forumid = t.forumid group by f.forumname,f.forumdesc; [/code] | |
Re: there is no limit on joining same table again. [code] SELECT Brochure.*, Leaders.Name, la.name as asst_name FROM Brochure LEFT JOIN Leaders ON Brochure.Leader=Leaders.ID left outer join leaders as LA on Brochure.Leader_asst=La.ID WHERE Brochure='2010 spring' AND Activity='biking' ORDER BY Date_Full [/code] | |
Re: 1) add two columns newlastname and newname 2) update them with lastname and name 3) drop columns name and lastname 4) rename newlastname to lastname and newname to name | |
Re: find the actual build query on screen using echo statement. then copy that whole query and run it in phpmyadmin or whatever mysql interface you use. check whether query is working at backend or not. [code] $sqlFilter .= ' AND (username LIKE "%'.$_SESSION['filter']['filterusername'].'%" OR active LIKE "%'.$_SESSION['filter']['filteractive'].'%" )'; echo $query.$sqlFilter … |
The End.