[PHP]HELP Charachter Kreator

Indította hodobaj, 2010 augusztus 13, 08:34:52 DÉLUTÁN

Előző téma - Következő téma

hodobaj

Hellosztok tegnap este gondoltam r

Jankec

ysqli_query($mysql_connect, "INSERT INTO charachters (guid, account, name, level, race, class, gender, health, power1, online, totalKills, totalHonorPoints, arenaPoints) VALUES ('".$post_guid."','".$post_account."','".$post_name."', '".$post_level."', '".$post_race."', '".$post_class."', '".$post_gender."', '".$post_level."', '".$post_health."', '".$post_power1."', '".$post_online."', '".$post_totalKills."', '".$post_totalHonorPoints."', '".$post_arenaPoints."')") or die(mysqli_error($mysql_connect));



ysqli_query ? inkább mysqli_query

ident

Fhatys, a sors által kirótt, elkerülhetetlen feladat szava.
http://eu.battle.net/wow/en/character/arathor/Ident/advanced

MySQL


imdawe

Üdv!
Ha nem tudod mysqli mire jó minek használod?
Használd csak nyugodtan sima mysql-t.;)
(mysqli OOP-ra van de mivel már rossz hogy mysqli_query függvényt használod inkább nézd át dokumentációt.)
De mielőtt ugatna valaki mert úgy szokás. :)
pár részlet doksiból.
What is PHP's mysqli Extension?

The mysqli extension, or as it is sometimes known, the MySQL improved extension, was developed to take advantage of new features found in MySQL systems versions 4.1.3 and newer. The mysqli extension is included with PHP versions 5 and later.

The mysqli extension has a number of benefits, the key enhancements over the mysql extension being:

    *      Object-oriented interface
...

.
Akkor még.
Idéz$post_class = mysqli_real_escape_string($mysql_connect, trim($_POST["class"]));
ezeket nem lenne egyszerűbb 1 foreach-al?
rövidebb és egyszerűbb megoldás.
!ereg("^[0-9%]+$", $post_health)
ehelyett mondjuk is_numeric fv.
+ ha sql query hiba lenne akkor egy sql error-t lekérhetnél
és meg tudhatjuk hogy valóban sql kérések a ludasak-e :)

Epic

[...]the MySQL improved extension, was developed to take advantage of new features found in MySQL systems versions 4.1.3 and newer.

Ez a lényeg. Az csak előny, hogy OO stílusban használhatod, nem véletlen van minden függvénynek egy procedurális megfelelője: http://hu2.php.net/manual/en/mysqli.summary.php

Epic

#6
És minden egyes leírásnál ott a procedurális változat, nem furcsa? :o

MySQL >=4.1.3 verzió esetén érdemesebb ezt a kiterjesztést használni, legyen az oop vagy sem, de tény, hogy célravezetőbb/jobb úgy használni, ahogyan Te gondolod.


Powered by EzPortal