Results 1 to 13 of 13
Thread: PHP
Hybrid View
-
26th September 2007 18:21 #1
PHP
!
!!
! , potrebiteli. 5 - id,ime,familia,potr_ime
: , !
:
,:
id ime familia potr_ime
1 nasko penchev edinak
, :
select * from potrebiteli where ime like "nasko";
! PHP. , ! :
!Code:<!doctype html public "-//W3C//DTD HTML 4.0 //EN"> <html> <head> <title>..::Results::..</title> <meta http-equiv="Content-Type" content="text/html; charset=windows-1251"></head> <body> <h1>eMagi results</h1> <?php $searchtype = $_POST['searchtype']; $searchterm = $_POST['searchterm']; if (!$searchtype || !$searchterm) { echo ' !'; } $searchtype = addslashes($searchtype); $searchterm = addslashes($searchterm); @ $db = mysql_pconnect('localhost', 'root', 'test'); if (!$db) { echo ' . - !'; exit; } mysql_select_db('potrebiteli'); $query = "select * from potrebiteli where ".$searchtype." like '%".$searchterm."%'"; $result = mysql_query($query); $num_results = mysql_num_rows($result); echo '<p>The Result of Your searching: '.$num_results.'</p>'; for ($i=0;$i < $num_results; $i++) { $row = mysql_fetch_array($result); echo '<p><strong>'.($i+1).'.: '; echo htmlspecialchars (stripslashes ($row['id'])); echo '</strong><br />: '; echo stripslashes($row['ime']); echo '<br />: '; echo stripslashes($row['familia']); echo '<br /> : '; echo stripslashes($row['potr_ime']); echo'</p>'; } ?> </body> </html>
:
The Result of Your searching:
P.S.
:
.Code:$result = mysql_query($query); mysql_query($sql) or die(mysql_error());
.
:
eMagi results
Query was empty
A, ! mysql-a!
! !Last edited by emagi; 27th September 2007 at 11:10.
-
26th September 2007 18:43 #2
. -> ... or die(mysql_error()); , !
-> LIKE "%$words[$i]%"
.. $_REQUEST $_POST, . globals.Code:$words = explode(' ',$searchterm);
??? $searchtype?Code:$query = "select * from potrebiteli where ".$searchtype." like '%".$searchterm."%'";
-
26th September 2007 18:48 #3
echo $query.'</ br>';
, .
$searchtype $searchterm ? .EVGA X299 FTW K|i9-7960X@4.7|4x8 Patriot Viper Steel 4000|GTX 1660 Ti|970 EVO 1 TB|Seasonic Focus GX-1000|Xigmatek Elysium|
Rampage IV Extreme BE|E5-1680v2@4.7|4x4 HyperX 1866|Cougar Aqua 240|GTX 1050 Ti|970 EVO 1/4 TB|CM 850 SilentPro|HAF-X|
-
26th September 2007 18:55 #4. " " " " ??Code:
$query = "select * from potrebiteli where ".$searchtype." like '%".$searchterm."%'";
( potrebiteli) ?
:
.. DISTINCT.$query = mysql_query("SELECT * FROM potrebiteli WHERE potrebiteli LIKE '%$words[$i]%' AND = '$searchterm'");
edit: . .
.
Last edited by z0ne; 26th September 2007 at 19:08.
-
27th September 2007 11:36 #5
! , po [b]id[/] 6! , , Petrov!
, :Code:+----------+------------+------------+------------------------------------+ | id | ime | familia | potr_ime | parola | +----+-----+------------+------------+-------------------------------------+ | 1 | Svetla | Panajotowa| Svetle | *23AE809DDACAF96AF0FD78ED04B6A | | 2 | Pavel | Petrov | emagi | *23AE809DDACAF96AF0FD78ED04B6A | | 3 | Kiril | Wylev | kiro | *899ECD04E40F745BD52A4C552BE4A | | 4 | Nadja | Stoqnova | asi | *FA12F1BDB7E27C0CA4F15E492CF70 | | 5 | Nasko | Gerchev | agpol | *007D50CA06F69776D307B1BEC71CD | +----+------+------------+-----------+-------------------------------------+
Query was empty
mysql!Last edited by emagi; 27th September 2007 at 11:44.
-
27th September 2007 12:05 #6Dark tranquillity
Join Date: Aug:2006
Location: Sofia
Posts: 796
- :
1. php- . ? .
2. phpmyadmin .
3. php, , , . " ..... 24 " " ..... " . . Mastering PHP Sybex PHP and mySQL Web Development. , .
4. . echo, var_dump print_r. , , , , . echo $query , mysql query-to phpmyadmin-. . .
. , , , .Core 2 Duo E6600 @ 3.15GHz + Zalman 9500| Gigabyte 965P DS-4 | Asus EAX1950Pro + Samsung 226BW | 4 x 1GB DDR-2 800 A-Data | CM Elite 330 + Fortron BS 500W | X-Fi Fatal1ty Pro | Samsung HD400LJ 400GB | NEC AD-7170A | MS Natural KB + A4 X7 G100 Game pad | Mouse A4 X750 BF
-
27th September 2007 12:19 #7
-
27th September 2007 12:36 #8Dark tranquillity
Join Date: Aug:2006
Location: Sofia
Posts: 796
, .
. , .
, , . .
: php.ini :
display_errors = on
off. off . , php 2-3 , .
- , , , . -
php ,
Core 2 Duo E6600 @ 3.15GHz + Zalman 9500| Gigabyte 965P DS-4 | Asus EAX1950Pro + Samsung 226BW | 4 x 1GB DDR-2 800 A-Data | CM Elite 330 + Fortron BS 500W | X-Fi Fatal1ty Pro | Samsung HD400LJ 400GB | NEC AD-7170A | MS Natural KB + A4 X7 G100 Game pad | Mouse A4 X750 BF
-
27th September 2007 12:48 #9
" " - , ! :
, , ! , , . , ! () RMIT ,! PHP MySQL, 3 !Code:Print out errors (as a part of the output). For production web sites, ; you're strongly encouraged to turn this feature off, and use error logging ; instead (see below). Keeping display_errors enabled on a production web site ; may reveal security information to end users, such as file paths on your Web ; server, your database schema or other information. display_errors = On
, !!!Last edited by emagi; 27th September 2007 at 12:56.
-
27th September 2007 13:00 #10Dark tranquillity
Join Date: Aug:2006
Location: Sofia
Posts: 796
,
, ";" ,
-:
display_errors = Off ( ; )
On, . , web server- ( Apache) . php ", 34"
, ,
Core 2 Duo E6600 @ 3.15GHz + Zalman 9500| Gigabyte 965P DS-4 | Asus EAX1950Pro + Samsung 226BW | 4 x 1GB DDR-2 800 A-Data | CM Elite 330 + Fortron BS 500W | X-Fi Fatal1ty Pro | Samsung HD400LJ 400GB | NEC AD-7170A | MS Natural KB + A4 X7 G100 Game pad | Mouse A4 X750 BF
-
27th September 2007 13:28 #11
, ! , -, , , - html POST php HTML , ,
:Code:$self = $_SERVER['PHP_SELF'];
, - ! ???Code:form action=\"$self\";
-
27th September 2007 13:46 #12Dark tranquillity
Join Date: Aug:2006
Location: Sofia
Posts: 796
- . /
Core 2 Duo E6600 @ 3.15GHz + Zalman 9500| Gigabyte 965P DS-4 | Asus EAX1950Pro + Samsung 226BW | 4 x 1GB DDR-2 800 A-Data | CM Elite 330 + Fortron BS 500W | X-Fi Fatal1ty Pro | Samsung HD400LJ 400GB | NEC AD-7170A | MS Natural KB + A4 X7 G100 Game pad | Mouse A4 X750 BF
-
27th September 2007 14:14 #13




Reply With Quote

Lenovo ThinkPad 15 IdeaPad 15
5th May 2023, 22:16 in