Jump to content

Trying to delete rows.


Vyizis

Recommended Posts

I am trying to use php to delete rows for a mysql database table, i am using the following code with $journeyIDToUse being a number that represents a automaticly incrementing primary key.

 

$toDelete = "DELETE FROM journeyData WHERE journeyID='$journeyIDToUse'";
mysql_query($toDelete);

 

This fails to delete the row. I have tried changing $journeyIDToUse to a number and that worked so i thought that the variable might be at fault but the following query works so that rules that out

 

$searchString = "SELECT * FROM journeyData WHERE journeyID='$journeyIDToUse'";
$result = mysql_query($searchString);
$row = mysql_fetch_array($result);

 

I cant work out what is happening here so any help will be more than appriciated.

 

Thanks

Vyizis

Link to comment
https://forums.phpfreaks.com/topic/43414-trying-to-delete-rows/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.