johnnys Posted November 26, 2014 Share Posted November 26, 2014 (edited) 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 November 26, 2014 by johnnys Quote Link to comment Share on other sites More sharing options...
Solution johnnys Posted November 26, 2014 Author Solution Share Posted November 26, 2014 Ah figured it out <?php echo '?isbn='.str_replace ('-', '', $row['isbn']); ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.