plz help me to write this query

Status
Not open for further replies.

hihotfile

Active Member
145
2010
35
0
hi
i am totally noob in mysql can you able to write query for generate tabel like this

doLmINk.png
 
6 comments
Code:
$var = mysql_query("INSERT INTO `table` (
                              `id` ,
                              `url` ,
                              `shortened`
                            ) VALUES (
                              'id' , 
                              'url', 
                              'shortened'
                            )");

Is this what you wanted ? explain a little more if its not you are been very vague.
 
Last edited:
Are you talking about URL shorter thing or so.

Also were you looking for what shadow.prx or about calling these values or something completely diff.
 
CREATE TABLE `table_name` (
`id` smallint(5) NOT NULL AUTO_INCREMENT,
`url` text NOT NULL,
`shortened` char(4) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
 
To Create table
PHP:
CREATE TABLE YOUR_TABLE_NAME
(
 ID INT NOT NULL IDENTITY(1,1),
 URL VARCHAR(100) ,
 SHORTEND VARCHAR(50),
 CONSTRAINT PK_ID PRIMARY KEY(ID) 
)

SQL is not case sensitive ;)

To Insert values
PHP:
INSERT INTO YOUR_TABLE_NAME VALUES
('URL_HERE','SHORTEND_HERE')



thats all, have more questions on SQL happy to help!
 
PHP:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>Example</title>
    </head>
    <body>

        <?php
            echo "Hi, I'm a PHP script!";
        ?>

    </body>
</html>


Oh, This is for mysql help :p
 
Status
Not open for further replies.
Back
Top