-4

I want to run a SQL query (or multiple queries) on database of my website in phpMyadmin in the SQL tab it says

SELECT * FROM `shell` WHERE 1

SO I typed in

SELECT * FROM `shell` WHERE 'http://samiul.ru.cx/c0de.php';

but I get an error

1054 - "Unknown column 'http://samiul.ru.cx/c0de.php' in 'where clause'

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459

3 Answers3

0

The shell should be an existing table on your phpMyadmin.

After the WHERE statement you should place your column name that you want to filter. For example your table shell contain a column name shell_name with a character data type. Your sql statement should look like:

SELECT * 
FROM shell
WHERE shell_name like 'any_name';

If your not planning to filter your table you can remove the WHERE statement.

Leaving you only the main sql statement:

SELECT * FROM shell;
Charlesliam
  • 1,293
  • 3
  • 20
  • 36
0

The general syntax for a select query with where clause is:

SELECT * FROM TABLE_NAME
WHERE COLUMN_NAME = 'PARTICULAR_COLUMN_VALUE';

Where clause is used to filter records that satisfy a particular filter criteria. For example, You have a table say EMP_TABLE with following structure and records,

EMP_NAME   |  EMP_NUMBER
NISHA      |  3322
GRASHIA    |  3696

If you want to fetch all columns of all records that have name as 'NISHA', then your query should be:

SELECT * FROM EMP_TABLE WHERE EMP_NAME = 'NISHA';

*Note: * in the above query can also be expanded as SELECT EMP_NAME, EMP_NUMBER where you can explicitly mention all the column names

If you want to fetch only particular column say emp number of employee 'NISHA' then your query can be:

SELECT EMP_NUMBER FROM EMP_TABLE WHERE EMP_NAME = 'NISHA';

For more reference on Syntax of WHERE CLAUSE

ngrashia
  • 9,869
  • 5
  • 43
  • 58
-1
SELECT * FROM *table* WHERE *column* = *value*

In your case:

SELECT * FROM shell WHERE webpage = 'http://samiul.ru.cx/c0de.php'

Or similar.

The WHERE 1 part is a little confusing.

SELECT * FROM table WHERE 1

is functionally the same as

SELECT * FROM table  

Here's an explanation: Importance of WHERE 1 in MySQL queries

I've never actually had a need for it, but maybe someone has.

This is a pretty basic question. You might want to read up a little on how queries work.

Community
  • 1
  • 1
crowhill
  • 2,398
  • 3
  • 26
  • 55