Author Topic: Picking out different letters from mysql.  (Read 244 times)

0 Members and 1 Guest are viewing this topic.

Offline whelptonTopic starter

  • Enthusiast
  • Posts: 97
    • View Profile
Picking out different letters from mysql.
« on: March 20, 2009, 03:51:45 PM »
Hi everyone,

Is there a way of modifying this, or using something similar, that will enable me to select users from the mysql database with the letter 'v'?

Code: [Select]
    <?php
include 
'/home/alport/public_html/shared/connect.php';
$query "SELECT * FROM Users ORDER BY Username ASC";
$result = @mysql_query($query);
if ($result){
while ($row mysql_fetch_array($resultMYSQL_ASSOC)){

Thanks

Offline PFMaBiSmAd

  • Guru
  • 'Insane!'
  • *
  • Posts: 14,588
  • In Coding, Automatic means you write code to do it
    • View Profile
Signature: (not a comment about anything you posted unless specifically indicated)
Debugging step #1: To get past the garbage-out equals garbage-in stage in your code, you must check that the inputs to your code are what you expect.

Programming is just problem solving, but it is done in another language. You must learn enough of the programming language you are using to be able to read and write code.

Offline Maq

  • Global Moderator
  • 'Insane!'
  • *
  • Posts: 11,004
  • Gender: Male
    • View Profile
    • Top Ecigs Reviews
Re: Picking out different letters from mysql.
« Reply #2 on: March 20, 2009, 04:03:49 PM »
Quote
Is there a way of modifying this, or using something similar, that will enable me to select users from the mysql database with the letter 'v'?

Do you mean anywhere in their name, or starting with v?
Electronic Cigarette Reviews - Smoking alternatives, find YOUR ecig!
ini_set ("display_errors""1");
error_reporting(E_ALL);

Offline whelptonTopic starter

  • Enthusiast
  • Posts: 97
    • View Profile
Re: Picking out different letters from mysql.
« Reply #3 on: March 20, 2009, 04:08:25 PM »
Quote
Is there a way of modifying this, or using something similar, that will enable me to select users from the mysql database with the letter 'v'?

Do you mean anywhere in their name, or starting with v?

Starting With A V

Offline Maq

  • Global Moderator
  • 'Insane!'
  • *
  • Posts: 11,004
  • Gender: Male
    • View Profile
    • Top Ecigs Reviews
Re: Picking out different letters from mysql.
« Reply #4 on: March 20, 2009, 04:18:46 PM »
You need to use something like:

Code: [Select]
LIKE 'V%'
Electronic Cigarette Reviews - Smoking alternatives, find YOUR ecig!
ini_set ("display_errors""1");
error_reporting(E_ALL);