Jump to content

While and ISBN Strip Hyphens


johnnys
Go to solution Solved by 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
Edited by johnnys
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.