Avatar of Pete Winter
Pete WinterFlag for United Kingdom of Great Britain and Northern Ireland

asked on 

Remove start and end space SQL / phpMyAdmin

Some of my data has spaces at the start or end and this is causing my SQL queries not to give the correct results.

Below is my query...

$query_rs_media_new_cat_filter = "SELECT DISTINCT category
								  FROM media_new
								  WHERE type = 'Ink' OR type='Misc'
								  ORDER BY category ASC";

Open in new window


How do I remove the space from the "category" output column?
PHPDatabasesMySQL Server

Avatar of undefined
Last Comment
Guy Hengel [angelIII / a3]
ASKER CERTIFIED SOLUTION
Avatar of Rgonzo1971
Rgonzo1971

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
SOLUTION
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of Pete Winter
Pete Winter
Flag of United Kingdom of Great Britain and Northern Ireland image

ASKER

Many thanks for the help
yes, retrieving from 2 tables can be faster... parallel reads
apart from the fact that small lookup tables are usually in memory anyhow (as hot tables)
PHP
PHP

PHP is a widely-used server-side scripting language especially suited for web development, powering tens of millions of sites from Facebook to personal WordPress blogs. PHP is often paired with the MySQL relational database, but includes support for most other mainstream databases. By utilizing different Server APIs, PHP can work on many different web servers as a server-side scripting language.

125K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo