| #r4bia whats wrong with the query? $query="DELETE FROM $bname WHERE id= $id"; |
|
| $query="DELETE FROM $bname WHERE id='$id'"; |
|
| still not working |
|
| what's the $bname? maybe it's $tbname or something like that |
|
| apa isi dari $bname ? |
|
| setuju sama atas ane |
|
| <?php include_once('connect.php'); echo $bname=$_GET['bname'];
$check=mysql_query("SELECT `id` FROM `$bname` WHERE `edate`=''"); $row =mysql_fetch_array($check); echo $id="id=".$row['id']; $query="DELETE FROM $bname WHERE id= '$id'";
?> |
|
| hasil echo nya ? |
|
| the id is echo well... |
|
| try like this:
$row =mysql_fetch_array($check); $id=$row['id']; $query="DELETE FROM $bname WHERE id= '$id'"; mysql_query($query); |
|
| ^ nice. Black Genies your bug is here... WHERE id = 'id = $row['id']' maybe |
|
| Fariz Yoga Syahputra i am from pakistan so please ask in english.. thankx |
|
| $bname is variable you wrong , must be fields from table in you database |
|
| ^yes its variable containing the table name... |
|
| oh i'm sorry |
|
| itu ada parameter `edate` nya kali yang gak kebaca. so you must make sure `edate` has a value. |
|
| to run $query string, you have to use mysql_query() function mysql_query($string); maybe like that |
|
| value $id is "id='that id', so delete bla... bla where id=id='that id'. isn't correct. to check echo your query's |
|
| $check=mysql_query("SELECT `id` FROM `$bname` WHERE `edate`=''"); $row =mysql_fetch_array($check); echo $id=$row['id']; echo $bname=$_GET['bname']; $query="DELETE FROM $bname WHERE id= '$id'"; mysql_query($query); the echo values b08/27/2013 and 5 |
|
| Use subquery broth !!! Delete from table where id IN (select from table2 where field = ? ) And the execute ... |
|
| just echo $query & paste in here the query's echo |
|
| didnt get u ^ |
|
| Change with this: $query="DELETE FROM `".$bname."` WHERE id='".$id."'"; |
|
| Your id condition contain array structure/ have more value...so use sub query |
|
| The problem is ur query contains "/" chars, that u must use ` char in front and back of variable of field name: ... FROM `$bname` WHERE ... like that, got it? |
|
| $query="DELETE FROM `".$bname."` WHERE id='".$id."'"; thnkx.this query works :) |
Tidak ada komentar:
Posting Komentar