1,257 Posted Topics

Member Avatar for decmatt

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]

Member Avatar for rajarajan2017
0
104
Member Avatar for jonathan96

simply echo word selected with space at line no 9 of your code echo " selected "; //correct DO NOT ASSIGN ANYTHING echo 'selected="selected"' //incorrect

Member Avatar for jonathan96
0
104
Member Avatar for Graffixnerd

To format your date output you may use date_format() function. refer mysql manual for details.

Member Avatar for griswolf
0
88
Member Avatar for alkeshtech

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.

Member Avatar for alkeshtech
0
94
Member Avatar for ds2r

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 …

Member Avatar for ds2r
0
134
Member Avatar for tweakernut

after line no 63 type end brace " } " for function, before "?>php" or line 12 if($alphaNumCheck) is without end brace " } "

Member Avatar for tweakernut
0
129
Member Avatar for qariella

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]

Member Avatar for qariella
0
174
Member Avatar for surya_nar
Member Avatar for futhonguy

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]

Member Avatar for futhonguy
0
90
Member Avatar for ItecKid

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 …

Member Avatar for urtrivedi
0
137
Member Avatar for dmkc

<?php echo "<a href=hotel-map.php?id=$pid><img src='myimage.jpg' width='100px' height='75px'></a>"; ?>

Member Avatar for dmkc
0
100
Member Avatar for preetg

check whether script source is a web address. May be jquery. then download equivalent js file.

Member Avatar for rajarajan2017
0
110
Member Avatar for missbusiness

[code] update mytable set crterm=bal/pi where somecolumn='my condition' [/code]

Member Avatar for Brian Swan
0
102
Member Avatar for sallecpt
Member Avatar for furqan219
0
114
Member Avatar for silviud

[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]

Member Avatar for silviud
0
120
Member Avatar for muralibobby2015

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.

Member Avatar for urtrivedi
0
100
Member Avatar for Vincent80

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.

Member Avatar for urtrivedi
0
160
Member Avatar for urtrivedi

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?

Member Avatar for urtrivedi
0
141
Member Avatar for QWaz
Member Avatar for urtrivedi
0
92
Member Avatar for izagaren123

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]

Member Avatar for izagaren123
0
497
Member Avatar for aneeka

select * from db1.table1 a left outer jion db2.table2 b on a.joincolname=b.joincolname

Member Avatar for urtrivedi
0
115
Member Avatar for Obelisk4

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]

Member Avatar for Obelisk4
0
157
Member Avatar for hitro456

sid data 1 abc 2 def 1 dfsf 2 sdfs suppose above is the case in your table, then what result do you expect?

Member Avatar for urtrivedi
0
97
Member Avatar for ds2r

following query will show 100 records and start from record no 20 [code] select * from table1 a where mycol='mycondition' limit 20, 100 [/code]

Member Avatar for ds2r
0
113
Member Avatar for MDanz

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]

Member Avatar for colweb
0
67
Member Avatar for hmortensen

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

Member Avatar for hmortensen
0
138
Member Avatar for slucia
Member Avatar for diafol
0
74
Member Avatar for manolisvl46
Member Avatar for manolisvl46
0
57
Member Avatar for michael_r

you can build your query as shown below [code] $query= " select * from mytable where company_name in ( '".implode("','",$_POST['flight'])."' )"; [/code]

Member Avatar for urtrivedi
0
85
Member Avatar for dan_ord

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.

Member Avatar for NettSite
0
72
Member Avatar for Exploded Fiber

[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]

Member Avatar for Exploded Fiber
0
65
Member Avatar for muralibobby2015

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]

Member Avatar for johny_d
0
95
Member Avatar for Encrypted

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

Member Avatar for Encrypted
0
256
Member Avatar for Pooja J.

in your index.php, change line no 14, pass connection resource and then try. $rs=mysql_query($query[B], $con[/B]);

Member Avatar for urtrivedi
0
84
Member Avatar for ayesha789

which field(s) is link between the two table, and what is the cardinality one-many or many to one between these tables.

Member Avatar for ayesha789
0
453
Member Avatar for python08

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]

Member Avatar for warren88
0
167
Member Avatar for lll_ari_lll

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 …

Member Avatar for lll_ari_lll
0
127
Member Avatar for ashab27

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]

Member Avatar for urtrivedi
0
180
Member Avatar for polly89

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 …

Member Avatar for diafol
0
131
Member Avatar for shellom2005

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]

Member Avatar for urtrivedi
0
467
Member Avatar for andydeans

[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 …

Member Avatar for andydeans
0
158
Member Avatar for rukshilag

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.

Member Avatar for urtrivedi
0
180
Member Avatar for ryan1987

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 …

Member Avatar for rch1231
0
90
Member Avatar for Tekkno

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.

Member Avatar for Tekkno
0
216
Member Avatar for masocha

set auto index for your new table using following query [code] ALTER TABLE tbl AUTO_INCREMENT = 100; [/code]

Member Avatar for urtrivedi
0
120
Member Avatar for Excizted

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>?

Member Avatar for almostbob
0
157
Member Avatar for jazz_vill

[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]

Member Avatar for urtrivedi
0
238
Member Avatar for amy_rockville

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]

Member Avatar for amy_rockville
0
123
Member Avatar for Krstevski

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

Member Avatar for drjohn
0
117
Member Avatar for JuliaNell

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 …

Member Avatar for urtrivedi
0
58

The End.