";

echo"AddDate
";

echo"Email
";

echo"SiteUrl
";

echo"Description
";

$id=$row->id;

HTML PHP HTML

echo"SiteNmae

name='name'value='$row->sitename'>";

HTML (INPUT) (TEXT) row html (name)

row sitename

html if


if($update){

if($name==""||$add_date==""||$email==""||$siteurl==""||$desc==""){

die("Youleftoneormorefieldsblank.");

}



$query2="updatedalalsetsitename='$name',add_date='$add_date',email='$email',site_url='$siteurl',description='$desc'

whereid='$id'";

mysql_db_query('links',$query2);

echo"Yourrecordhasbeenupdated

";

}

mysql_close();

?>



add.php if

if($name==""||$add_date==""||$email==""||$siteurl==""||$desc==""){

die("Youleftoneormorefieldsblank.");

}

You left one or more fields blank

$query2="updatedalalsetsitename='$name',add_date='$add_date',email='$email',site_url='$siteurl',description='$desc'

whereid='$id'";

mysql_db_query('links',$query2);

echo"Yourrecordhasbeenupdated

";

}

mysql_close();

query2 SQL update

update

Update tablename Set (values

sitename values

name,add_date,email,site_url,description

dalal where

$id=id

mysql_db_query

query2

mysql_colse

";

echo"Description
";

$id=$row->id;

}

echo"
: a7med mohmed
      .....       .....       MMS .....       MMS .....       MMS .....       MMS .....       MMS .....       MMS .....       .....       .....


PHP
::
::
:
10 :
306 :
136 :
180 :
388582 :




EditTheInfo


include("config.php");

mysql_pconnect($dbhost,$dbuname,$dbpw);

@mysql_select_db("$dbname")ordie("Unabletoselectdatabase");



$query1="select*fromdalalwhereid='$id'";



$result1=mysql_db_query('links',$query1);



while($row=mysql_fetch_object($result1)){

echo"SiteNmae
";

echo"AddDate
";

echo"Email
";

echo"SiteUrl
";

echo"Description
";

$id=$row->id;

}

echo"
» PHP »


SiteName:

DateAdd:



description:



URL:



Email:







:


SiteName:

DateAdd:



description:



URL:



Email:







:: 2011/01/15   ||   :: 2381

.

(Table)

ڠ (one table) (sql)

(Relationstips)

,

CREATETABLEdalal(
idintnotnullauto_increment,
sitenamevarchar(100),
add_datedate,
emailvarchar(100),
site_urlvarchar(100),
descriptiontext,
primarykey(id));

:

id .

sitename char

add_date date

email char (100)

site_url char

id

id (primary key)

:

primarykey(id)

id

Ҡ

id ( int ) ( not null )

not null .

not null ( auto_increment ) ɠ ( 1 )

( id ) ( 1 )

config.php

:

//thismoudelconfig

$dbname="links";

$dbuname="root";

$dbpws="";

$dbhost="localhost";

?>

php

:

add.php :







body{font-family:verdana,verdana;font-size:10pt}

TD{font-family:verdana,verdana;font-size:10pt}

#header{color:white;font-weight:bold;font-family:verdana,verdana}

A{color:navy;text-decoration:underline}

A:hover{color:red}

A:visit{color:navy}




if($action=='addsite')

{

include("config.php");

mysql_pconnect($dbhost,$dbuname,$dbpw);

@mysql_select_db("$dbname")ordie("Unabletoselectdatabase");

mysql_query("insertintodalalvalues('','$name','','$email','$siteurl','$des')");

mysql_close();

echo"Thankyouforaddsite";

}

?>





SiteName

Email

SiteUrl

description

View

html php php

html php

if($action=='addsite')

('addsite') html form (add.php?addsite)



SiteName

Email

SiteUrl

description


( post ) ( action ) (add.php?addsite )

(action) submit ( ) (add.php?addsite)

include("config.php");

include

mysql_pconnect($dbhost,$dbuname,$dbpw);

@mysql_select_db("$dbname")ordie("Unabletoselectdatabase");

mysql_pconnect

config.php

include

mysql_pconccet

@mysql_select_db("$dbname")ordie("Unabletoselectdatabase");

mysql_select_db dbname

@

:

mysql_query("insertintodalalvalues('','$name','','$email','$siteurl','$des')");

mysql_query (sql) mysql_query (Insert)

sql

INSERTINTOtablenameVALUES(varandvalues)

INSERT INTO

VALUES (var (" ") ;

mysql_query insert dalal

mysql_colse ʠ

add.php config.php

show.php







body{font-family:verdana,verdana;font-size:10pt}

TD{font-family:verdana,verdana;font-size:10pt}

#header{color:black;font-weight:bold;font-family:verdana,verdana}

A{color:navy;text-decoration:underline}

A:hover{color:red}

A:visit{color:navy}



viewThesites



AddYourSite







include("config.php");

mysql_pconnect($dbhost,$dbuname,$dbpw);

@mysql_select_db("$dbname")ordie("Unabletoselectdatabase");



$query="select*fromdalal";



$result=mysql_query($query);



mysql_close();



/*DisplayResults*/



$num=mysql_numrows($result);



$i=0;

while($i<$num){





$sitename=mysql_result($result,$i,"sitename");

$add_date=mysql_result($result,$i,"add_date");

$email=mysql_result($result,$i,"email");

$siteurl=mysql_result($result,$i,"site_url");

$description=mysql_result($result,$i,"description");

$id=mysql_result($result,$i,"id");

?>





[EditThisSite]




++$i;

}



?>







add.php

$query="select*fromdalal";

query dalal

select ( * ) from

select * from dalal

query

ɠ

(" ")

$result=mysql_query($query);

result mysql_qurey mysql_query result

mysql_query query dalal mysql_query

( )

mysql_colse

/*Display Results*/

num mysql_numrows result

mysql_numrows result num

i while while

$i < $num

i num

$sitename=mysql_result($result,$i,"sitename");

$add_date=mysql_result($result,$i,"add_date");

$email=mysql_result($result,$i,"email");

$siteurl=mysql_result($result,$i,"site_url");

$description=mysql_result($result,$i,"description");

$id=mysql_result($result,$i,"id");

?>





[EditThisSite]




++$i;

}

WHILE

$sitename=mysql_result($result,$i,"sitename");

mysql_result result i

sitename

html ʠ

while { i Ǡ ɠ

show.php edit.php

edit.php







body{font-family:verdana,verdana;font-size:10pt}

TD{font-family:verdana,verdana;font-size:10pt}

TH{font-size:10pt;color:white;font-weight:bold;font-family:verdana,verdana}

A{color:navy;text-decoration:underline}

A:hover{color:red}

A:visit{color:navy}

#mySelect{font-family:verdana,arial;font-size:9pt}





EditSite

AddYourSite|

ViewEditdatabase








";?>



";

echo"
";

?>










if($update){

if($name==""||$add_date==""||$email==""||$siteurl==""||$desc==""){

die("Youleftoneormorefieldsblank.");

}



$query2="updatedalalsetsitename='$name',add_date='$add_date',email='$email',site_url='$siteurl',description='$desc'

whereid='$id'";

mysql_db_query('links',$query2);

echo"Yourrecordhasbeenupdated

";

}

mysql_close();

?>



$query1="select*fromdalalwhereid='$id'";

query1 where "" sql "" id id id primary key

edit id id 1 4

$result1=mysql_db_query('links',$query1);

result

mysql_db_query query

mysql_db_query mysql_query

while

while($row=mysql_fetch_object($result1))

row php ( while ) mysql_fetch_object result1

mysql_fetch_object

while

while($row=mysql_fetch_object($result1)){

echo"SiteNmae
";

echo"AddDate
";

echo"Email
";

echo"SiteUrl

";

echo"
";

?>




if($update){

if($name==""||$add_date==""||$email==""||$siteurl==""||$desc==""){

die("Youleftoneormorefieldsblank.");

}



$query2="updatedalalsetsitename='$name',add_date='$add_date',email='$email',site_url='$siteurl',description='$desc'

whereid='$id'";

mysql_db_query('links',$query2);

echo"Yourrecordhasbeenupdated

";

}

mysql_close();

?>

IF :

echo"SiteNmae

:
: ( 0 )
»»