Jump to content

While and ISBN Strip Hyphens


johnnys

Recommended Posts

Firstly I'm sure the answer is simple however due to my inexperience I am unable to figure it out!

 

I am executing a simple query to retrieve all ISBN numbers within my db and display these in a table.

In my db some of the ISBN numbers contain hyphens and some don't. I would like to display then in my table without hyphens.

 

I'm grateful of any assistance and advice.

 

I know I can remove all the hyphens from the db by executing a separate query however I'd like to strip them if possibly.

 

My Code;

$query = "SELECT * FROM book WHERE status != 'Archive' ORDER BY id";

while($row = mysqli_fetch_array($query)){ 

?> 

<tr>
<td><a href="itemView.php<?php echo '?isbn='.$row['isbn']; ?>" </a></td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
</tr>   

<?php  }  ?>
J
Link to comment
https://forums.phpfreaks.com/topic/292724-while-and-isbn-strip-hyphens/
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.