I m doing a project in which i have to delete some data by matching 2 different fields. i m using and operator but it is not working in php page but it is working properly in phpmyadmin. So, please provide me some solutions about integration to php page with my-sql.

<?php
$q1= "delete from table3 where item_id='$a' AND vou_no='$a'";
?>

Recommended Answers

All 4 Replies

Member Avatar for GreenDay2001

Your query is fine. There might be something wrong with your PHP code. Check it, or post it here for help.

I m doing a project in which i have to delete some data by matching 2 different fields. i m using and operator but it is not working in php page but it is working properly in phpmyadmin. So, please provide me some solutions about integration to php page with my-sql.

<?php
$q1= "delete from table3 where item_id='$a' AND vou_no='$a'";
?>

check if those variables, $a & $b are getting values

If you are checking two different values, shouldn't they both be in the sql ? Currently both fields are referring to $a.

yeah i agree with network18, check for the values of $a and $b... the fact that it work fine in phpmyadmin means your query is fine and should satisfy the query statement... if you had the correct values of $a and $b the query will return true.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.