wannabeeaweak
Nov 17 2005, 04:26 AM
hey well can some one helpme make this code work it won't INSERT INTO THE DATABSE CODE <?php # register1.php # common include file to MySQL include("DB.PHP");
$Username=$_POST['Username']; $Password=$_POST['Password']; $Name=$_POST['Name']; $Last=$_POST['Last']; $Sex=$_POST['Sex']; $Month=$_POST['Month']; $Day=$_POST['Day']; $Year=$_POST['Year']; $Adresse=$_POST['Adresse']; $City=$_POST['City']; $State=$_POST['State']; $Zipcode=$_POST['Zipcode']; $Country=$_POST['Country']; $Phone=$_POST['Phone']; $Email=$_POST['Email']; $Father_Name=$_POST['Father_Name']; $Mother_Name=$_POST['Mother_Name']; $Parent_Phone=$_POST['Parent_Phone']; $Parent_Email=$_POST['Parent_Email']; $Level=$_POST['Level']; $Academic=$_POST['Academic']; $Image_Link=$_POST['prevImage'];
$sql9="INSERT INTO User SET id = 'NULL', Username = '$Username', Password = '$Password', Name='$Name', Last='$Last', Sex='$Sex', Month='$Month', Day='$Day', Year='$Year', Adresse='$Adresse', City='$City', State='$State', Zipcode='$Zipcode', Country='$Country', Phone='$Phone', Email='$Email', Father_Name='$Father_Name', Mother_Name='$Mother_Name', Parent_Phone='$Parent_Phone', Parent_Email='$Parent_Email', Level='$Level', $Academic='$Academic'"; $sql3="SELECT * FROM User WHERE Username='$Username' AND Password='$Password'"; $sql4="SELECT * FROM User WHERE Email='$Email'";
# insert login/password $result = mysql_query($sql); if (!$result) { echo "Please Try Again"; } else { echo"Thank you for sign up"; } mysql_close($connection); ?>
Reply
Houdini
Nov 17 2005, 11:44 AM
Did I miss something in the above or did you connect to the database somewhere else? It needs to connect first then it can insert, do you get an error with the above. Usually you would start with CODE $connect = mysql_connect($host,$user,$password) die ("Couldn't connect to server!"); $db = mysql_select_db($database,$connect) die("Couldn't select databse!");
Reply
wannabeeaweak
Nov 22 2005, 01:48 AM
QUOTE(Houdini @ Nov 17 2005, 03:44 AM) Did I miss something in the above or did you connect to the database somewhere else? It needs to connect first then it can insert, do you get an error with the above. Usually you would start with CODE $connect = mysql_connect($host,$user,$password) die ("Couldn't connect to server!"); $db = mysql_select_db($database,$connect) die("Couldn't select databse!"); CODE include("DB.PHP"); thats where that is
Reply
vujsa
Nov 22 2005, 06:48 AM
So Houdini's question was the first one I had too the first time I looked at this. Next time be sure to include any external code that we may need to help debug. Next I found another problem. You run an mysql query on $sql but $sql doesn't exist. QUOTE(wannabeeaweak @ Nov 16 2005, 11:26 PM) CODE # insert login/password $result = mysql_query($sql); <--------------------------------- HERE!!!!!! if (!$result) { echo "Please Try Again"; } else { echo"Thank you for sign up"; } mysql_close($connection); ?>
QUOTE(wannabeeaweak @ Nov 16 2005, 11:26 PM) hey well can some one helpme make this code work it won't INSERT INTO THE DATABSE CODE $sql9="INSERT INTO User ..... $sql3="SELECT * FROM User WHE..... $sql4="SELECT * FROM User WHE.....
You actually need to run the seperate querries on $sql9, $sql3, and $sql4! I suggest writting a function that could be generic enough to handle any variable. Maybe: CODE function boogy_down($sql){ $result = mysql_query($sql); if (!$result) { echo "Please Try Again"; } else { echo"Thank you for sign up"; } }
With the funtion call of: CODE boogy_down($sql9); boogy_down($sql3); boogy_down($sql4);
Now keep in mind that that particular function will output "Thank you for sign up" 3 times if successful. It would be better to put the variables in an array and add a loop to the function then if all commands are successful, echo "Thank you for sign up"! I'm not going to write the whole thing for you but this should at least get you back on track. Hope This Helps!  vujsa
Reply
Hercco
Nov 23 2005, 12:49 PM
Yep, you're basically entering an empry query as $sql is not defined. But a generic function for different types of queries might be a bit useless as the return values of mysql_query can be very different, ranging from simple boolean values of a say INSERT to big results of SELECT queries. I don't if you meant to do it but although otherwise a possible thing to do would be to send multiple queries tot the databse at once, separated by semicolons this is not possible with PHP as it is considered a security threat. You code would miss the appending of the quesries anyways so you probably weren't thinking about this.
Reply
vujsa
Nov 23 2005, 11:30 PM
QUOTE(Hercco @ Nov 23 2005, 07:49 AM) Yep, you're basically entering an empry query as $sql is not defined. But a generic function for different types of queries might be a bit useless as the return values of mysql_query can be very different, ranging from simple boolean values of a say INSERT to big results of SELECT queries. I don't if you meant to do it but although otherwise a possible thing to do would be to send multiple queries tot the databse at once, separated by semicolons this is not possible with PHP as it is considered a security threat. You code would miss the appending of the quesries anyways so you probably weren't thinking about this. I didn't look closely enough to see that there was both INSERT and SELECT commands being sent as a result, the very least you should use a different function for each type unless you are pretty good with your function writing. vujsa
Reply
Hercco
Nov 29 2005, 09:17 PM
QUOTE(vujsa @ Nov 24 2005, 01:30 AM) I didn't look closely enough to see that there was both INSERT and SELECT commands being sent as a result, the very least you should use a different function for each type unless you are pretty good with your function writing. vujsa I guess there could be alternative methods inside the function. It would check whether the query starts with SELECT or INSERT and the select the proper action. Would be a bit messy function but on the other hand the actual code would look neat with only single type of function calls for database queries.
Reply
vujsa
Nov 30 2005, 01:46 AM
I tend to write a perfectly good function for one use. Then later when I need a similar function, I just modify the first function. Then later, I need yet another similar function and repeat the process. I tend to write very complex functions as a result which are able to handle several different requests and then the function call is very simple to write as a result. Since most of my database functions are all-in-one, I just need to use the same call each time with different variables. Then I tend to name my function something like deal_with_the_db() which is what it does and I don't have to think about the DB anymore. LOL I tend to get frustrated with the mySQL commands so I remove myself a little. By the way, why is it so difficult to get information out of the database even if you have all of the required information and you only want one entry.  vujsa
Reply
TavoxPeru
May 6 2006, 12:30 AM
QUOTE(wannabeeaweak @ Nov 16 2005, 11:26 PM)  hey well can some one helpme make this code work it won't INSERT INTO THE DATABSE CODE <?php # register1.php # common include file to MySQL include("DB.PHP");
$Username=$_POST['Username']; $Password=$_POST['Password']; $Name=$_POST['Name']; $Last=$_POST['Last']; $Sex=$_POST['Sex']; $Month=$_POST['Month']; $Day=$_POST['Day']; $Year=$_POST['Year']; $Adresse=$_POST['Adresse']; $City=$_POST['City']; $State=$_POST['State']; $Zipcode=$_POST['Zipcode']; $Country=$_POST['Country']; $Phone=$_POST['Phone']; $Email=$_POST['Email']; $Father_Name=$_POST['Father_Name']; $Mother_Name=$_POST['Mother_Name']; $Parent_Phone=$_POST['Parent_Phone']; $Parent_Email=$_POST['Parent_Email']; $Level=$_POST['Level']; $Academic=$_POST['Academic']; $Image_Link=$_POST['prevImage']; $sql9="INSERT INTO User SET id = 'NULL', Username = '$Username', Password = '$Password', Name='$Name', Last='$Last', Sex='$Sex', Month='$Month', Day='$Day', Year='$Year', Adresse='$Adresse', City='$City', State='$State', Zipcode='$Zipcode', Country='$Country', Phone='$Phone', Email='$Email', Father_Name='$Father_Name', Mother_Name='$Mother_Name', Parent_Phone='$Parent_Phone', Parent_Email='$Parent_Email', Level='$Level', $Academic='$Academic'";
Your SQL Insert statement is wrong, you confused it with the UPDATE SQL Statement, the correct way to write it is: CODE $sql9="INSERT INTO User( Username, Password, Name, Last, Sex, Month, Day, Year, Adresse, City, State, Zipcode, Country, Phone, Email, Father_Name, Mother_Name, Parent_Phone, Parent_Email, Level, Academic) Values('$Username', '$Password', '$Name', '$Last', '$Sex', '$Month', '$Day', '$Year', '$Adresse', '$City', '$State', '$Zipcode', '$Country', '$Phone', '$Email', '$Father_Name', '$Mother_Name', '$Parent_Phone', '$Parent_Email', '$Level', '$Academic')";
mysql_query($sql9) or die(mysql_errno(). ": " . mysql_error() );
I dont include the id field because i think it is an integer autonumeric field, let me know if im wrong about it, also you must verify all your data prior to your insertion, maybe using javascript in your forms page and another good practice to prevent sql injections is the use of the mysql_real_escape_string function if your system has the magic_quoutes_gpc off. Best regards,
Reply
minnieadkins
May 8 2006, 02:17 PM
QUOTE(TavoxPeru @ May 5 2006, 08:30 PM)  Your SQL Insert statement is wrong, you confused it with the UPDATE SQL Statement, the correct way to write it is: CODE $sql9="INSERT INTO User( Username, Password, Name, Last, Sex, Month, Day, Year, Adresse, City, State, Zipcode, Country, Phone, Email, Father_Name, Mother_Name, Parent_Phone, Parent_Email, Level, Academic) Values('$Username', '$Password', '$Name', '$Last', '$Sex', '$Month', '$Day', '$Year', '$Adresse', '$City', '$State', '$Zipcode', '$Country', '$Phone', '$Email', '$Father_Name', '$Mother_Name', '$Parent_Phone', '$Parent_Email', '$Level', '$Academic')";
mysql_query($sql9) or die(mysql_errno(). ": " . mysql_error() );
I dont include the id field because i think it is an integer autonumeric field, let me know if im wrong about it, also you must verify all your data prior to your insertion, maybe using javascript in your forms page and another good practice to prevent sql injections is the use of the mysql_real_escape_string function if your system has the magic_quoutes_gpc off. Best regards, Actually you can do a traditional CODE INSERT INTO table(value1, value2) VALUES('SomeValue', 'SomeValue2') But I think in mysql it'll let you address an insert statement as if you're updating, which isn't the same for postgres. Try it and let me know what you find out, but I'm pretty sure it's allowed. In this case he's wating to insert, not update. I was looking at a previous script that one of my professors wrote usuing a mysql database and his insert scripts looked a lot like the update statements. When we switched over to postgres we had to redo the insert statements to match to the traditional insert statement. It would probably be wise to stick with traditional unless you plan on staying with mysql. Vujsa, you don't actually use a dbi? You just right your own code to supplement the use of db connections/queries? I was introduced to a dbi that's based on perl's standard dbi or something like that. I like it a lot better than all the php functions to deal with mysql/postgres. It standardizes everything, so whatever you want to do (use mysql, or postgres) you use same function call. You just change the inital connection's function to receieve a string argument of what database. I believe that's the way it's done, but with the script I'm working on there's about 10 different includes to every page in order to make it work right. Good experience tho. After thinking about it I can see the advantage of writing a script that does what you're talking about vujsa. Have a function like build_db_query or something that builds the actually query and returns it as a string perhaps. You pass a table name, and an array of values in an assoc array indexing the related tables in the fields. You could make it even more flexible and add flag to determine whether it's a select, insert, update, or delete statement. Just have a switch on the flag, then build the appropriate sql statement. I'm rather new to OOP and php, but can't this be done with polymorphism? (rather new to OOP in general)
Reply
Latest Entries
Arbitrary
Jul 20 2008, 03:17 AM
QUOTE After thinking about it I can see the advantage of writing a script that does what you're talking about vujsa. Have a function like build_db_query or something that builds the actually query and returns it as a string perhaps. You pass a table name, and an array of values in an assoc array indexing the related tables in the fields. You could make it even more flexible and add flag to determine whether it's a select, insert, update, or delete statement. Just have a switch on the flag, then build the appropriate sql statement. This has been done before in the CakePHP framework (see http://api.cakephp.org/class_model.html#eb...b5a35dd428f5c81 and I'm sure numerous other PHP frameworks that I don't work extensively with as well), except that Cake didn't take advantage of PHP's OOP because it also wanted to be PHP 4 compatible. It just requires that you pass in the variables in a certain format (in Cake's case it's an array) and then parse based on the fields and values in that format. It is really quite flexible and makes saving data a lot faster than writing the same old INSERT functions. Especially in this case where the insert function is exceptionally huge, having a function like that would be a huge advantage. Hey hotsam! I'd say for your firearms and reviews, you don't need a many-to-many relationship. After all, each review only has one firearm; each review wouldn't have multiple firearms, would they? Then each firearm would have many reviews, which would make sense. As for the business to firearm relationship, I'm not sure if a firearm can have many businesses--that would depend on the license, right? Aren't many firearms licensed so that they're only made by one business? (Then again, I'm not familiar with their creation...) Everything else makes sense to me. :-) Good luck!
Reply
hotsam
Jul 20 2008, 02:47 AM
Hi, Below is a picture of my database tables, and their relationships. I was hoping someone might have a quick look and tell me if I'm on the right track, or if I need to: Change PRIMARY keys Change INDEX / FOREIGN keys Change Table Structures Also, I'd like to add a table that stores the various CALIBERS that firearms are available in. I'm thinking the relationship would be many-to-many, as a firearm can have many calibres, and a calibre is available for many firearms...? How would I make the CALIBRE table? What fields should the table contain, and how should it relate to the FIREARMS table? I'd like to be able to output a list of firearms, and show available calibres for each of those firearms. Just to help out, the database will be used to: - search for firearms and their available calibres - show retailers that sell a particular make of firearm - show reviews that owners (users) submit. These will be shown alongside each firearm searched for http://home.exetel.com.au/jazzy/relationships.pngThanks for any help! Jarrad
Reply
iGuest
May 6 2008, 05:02 AM
business logic validation
Need Help With A PHP - MySQL Registration Script
How to do business logic validation to check whether duplicate username is already existing in database using php -question by kalai
Reply
Recent Queries:--
mysql autonumeric field - 10.67 hr back. (1)
-
phpmysql registration - 16.63 hr back. (1)
-
php get url and insert into mysql sessions table - 35.91 hr back. (1)
-
is_numeric in php oop - 39.61 hr back. (1)
-
php mysql registration script check for duplicates - 40.61 hr back. (1)
-
php script with insert and select sql - 63.63 hr back. (1)
-
mysql upload file with autonumeric fields - 85.55 hr back. (1)
-
inserting & getting php scripting informayion into mysql - 89.50 hr back. (1)
-
phpbb 3 mysql insert page - 89.86 hr back. (1)
-
php mysql updates not happening in function - 90.76 hr back. (1)
-
php register script insert into - 96.25 hr back. (1)
-
simple php mysql register script - 97.15 hr back. (1)
-
registration script with mysql - 104.78 hr back. (1)
-
php mysql verify insert successful - 107.25 hr back. (1)
Similar Topics
Keywords : php, mysql, registration, script, insert, database
- Myspacetv Download Php Script Help
(6)
Php Login Script
(0) login script click the link to get your free php login script installer just follow the
instuctions the exe gives you and it will give you the script just place the code in the sever and
open index.html and follow on from there. what it has: it has reg page, login protection code ect.
it is simple to use and i think quite fun but im BORN TO BE WEIRD,you will need at least one working
mysql data base /biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif"
/> hope you enjoy it. iknow i did from the alexmedia crew....
Make A Script Run Even If No User Is Online
(6) Hey! Is there any way to make a script run, even if no user is online. Because at the moment, my
scripts run, only when a user is online. And another thing: How can i make the following: (this is
just an example) mysql_query"SELECT maxhp FROM users WHERE username = 'allusers'"; How can I
select all users maxhp, in the same query? Thanks //Feelay....
Letting Users Add Mysql Data With Php
(1) I'm curious as to the best methods of letting users submit data to a MySQL database, displaying
that data, and removing any unwanted tags etc. from it. Currently, there's a handful of PHP
functions that I know of to help with this: mysql_real_escape_string() - perhaps the best known
and most commonly used function, it should be used in pretty much any MySQL query. It escapes
characters that have SQL significance. QUOTE(php.net) ...which prepends backslashes to the
following characters: \x00, \n, \r, \, ', " and \x1a I like....
Writing And Testing My Own Login Script [solved]
(20) i have this error QUOTE Warning: session_start() : Cannot send session cache limiter - headers
already sent (output started at /home/eggie/public_html/race.php:2) in
/home/eggie/public_html/race.php on line 5 in every page i have with session start...what's
the problem?? CODE <title>Race</title> <?php
include("style.css"); include("config.php");
session_start(); if(!session_is_registered(myusername)){ echo 'Your
Session has Expired!'; exit;} //If you click race.....
Mysql Question(inserting Number From A Textfield)
(3) Hey! I am trying to do a "Admin give EXP script". But I can't make it work. The value is
not updating, but the update query is correct.( I think:P) I think the fault is here: CODE
$expcomp=$givexpp['exp'] += $givexp; The $givexp is the
variable for the amount of Xp the admin wants to give. the $givexpp is the variable for the
user info (in this case, the experince he already have). The datatype for the XP in the database is
INT. So I have no idea if it can take data from a normal textfield. If you need to see all....
Making Something In Mysql Happen Only Once
(10) Hey! I know I am asking alot. But much is happening theese days. Sorry if I disturb with my
questions. The thing I am trying to do is: Ex. If the user becomes level 2, he should get 5 skill
points. I can't do this: CODE if($userlevel=5){ mysql_query("UPDATE
user SET skillpoints =$points+5");} because then it would update everytime the code
was loaded. I hope you understand what I am trying to do. If not, tell me /smile.gif"
style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> and i'll try to explain....
Making A Link = Mysql_query
(8) Hey! I will try to make this as clear as possible. how can I make the following. I have a
list, of all members on my site. If I press on a members name(link), I will come to his profile. To
come to his profile, I need to get out some vaule from the database, but to get out some value from
the database, I must tell the code, how it should know who the user is (hard to understand?). To do
that, I must add a mysql_query in the code ( I think), like "SELECT user FROM dbname WHERE
user=link".. This is just how I think it works. I know it is kinda wrong.. but I don'....
Script Request
script request (2) another script request i am looking for a file manger tutorial with edit delete search upload move
copy and a WYSIWYG(What You See Is What You Get) editer like on on freewebs.com and css editor plz
help! i need on badly vmkrightpoint Edit"i keep search google and msn and yahoo i can't
find on!! lol"....
Free Forum Hosting Type Script Help!
Free forum hosting type script help!!! (2) i want to make something like http://invisionfree.com/ that makes an dir with your phpbb 3 forum
in it with an admin CP plz help i really want to make something like it!! i was thinking
of coding my own with file handling but i'm not good at some of it like "when u click submit to
register a forums it will move the phpbb3 file that leads to the users dir then it will rename the
dir to your username so like my.site.com/username it might work" with the admin username and pass
and admin's email it will open the config.php then edit all the data but it....
Login Script
(8) I have another question--- i downloaded script of a game and it worked until my server changed to
newer version of php after which it didn't work... the most probable reason is that globals are
not enabled... now i need someone who can tell me what to put instead of what to make it work...
this is my login.php script CODE <?php $title = "Login"; if
(!$user || !$pass) { include("head.php"); print
"Please fill out all fields."; include("foot.php"); exit; }
include....
How To Make A Value In The Database Raise Every Minute.
(50) Hi. I am trying to figure out how to make a value in the database raise every minute. Lets say, I
want the HP to raise every minute. The max HP is 100. I want it to raise 5 HP/ Hour. And the player
don't have to be online. Anyone who know how I can do it =? Thanks for any help. //Feelay....
Password Recovery Script
(6) While trying to make password recovery script for "bhupinunder" i run into a problem... i made this:
CODE <?php $dbh =
mysql_connect('localhost','jaskaran_gc','gc') or die
("Cannot Connect: " . mysql_error());
mysql_select_db('jaskaran_gc',$dbh); ?> <form method=post
action=restore.php?recover=answer> <?php
print"Email:</td><td><input type=text
name=email></td></tr>";?> <P><INPUT TYPE=submit VALU....
Warning: Mysql_result(): Supplied Argument Is Not A Valid Mysql Result Resource In ...
This Is for My attack Script. (4) Hey. I am making a "Version 2.0" For my attack script, but I can't make it work. This is the
error I am gettin: Warning: mysql_result(): supplied argument is not a valid MySQL result resource
in And here is the code: CODE $dbQueryHealth = mysql_query("SELECT
temphealth FROM characters WHERE user =".
$_POST['atkuser'].""); $currentHealth =
mysql_result($dbQueryHealth, 0); $dbQueryExp =
mysql_query("SELECT exp FROM characters WHERE user = ".$....
Warning: Mysql_num_rows()
What is the error :S (1) Hey! I've made a register script.. Some time ago it worked. And I ain't sure if I
changed something since then.. The error I am getting is this: Warning: mysql_num_rows(): supplied
argument is not a valid MySQL result resource in /home/feelay/public_html/regcheck.php on line 31
Here is the code on theese lines: CODE $sqlCheckForDuplicate = "SELECT username FROM
user WHERE username = '". $username ."'"; if(
mysql_num_rows( mysql_query( $sqlCheckForDuplicate ) ) == 0 ) ....
SQL Doesn't Connect In PHP Script
I made some code updates now the script is broken. (19) i have created a website and it is not working properly... i have had a website on sphosting.com and
everything worked fine till i got some errors(i got the errors because of the crappy host)...now the
fun part starts...they said they solved the problem but i got another one..i said them to repair it
again and they did...now i tried to login but as i entered the info it said the info isn't
correct...i checked the SQL and everything seemed fine..i tried again and again the error came...i
tried than to register,entered ALL info and when this was suppose to come out "Yo....
Php Script Help
help with scripting of php (1) Ok first a little back story of what happened and why I am asking for help. I have been playing text
based rpgs and found that I really like them. Well I have also found that most programers don't
want to listen to their clients in the sugestion box and when u make a content sughesstion they get
rude or make fun of your idea. So I decided I would sart my own and make it where the users had say
so in added content. Not saying all sugestions will get added but I will not make fun or get mad at
them. Any who when I bought the script I was under the impression it was fu....
Run A Script When Expires A Session
(6) For example, when a user logins to a page -with a login form- and after validating and verifying
it's credentials i store some information related to this user in session variables and a table
with his state -connected- is updated, then i use it in other pages, etc. When this user logouts
-by clicking a logout link- i release -unregister, destroy, etc- all the session variables stored
and the same table is updated with his state -disconnected-. All of this funcionality works very
well, the problem comes when the user do not click on the logout link and the session ....
Automated Product Suggestion Script
Compare user lists and suggest related items based on pattern matching (2) I recently got an idea for a project and one of the features I wanted the project to have was an
automated suggestion service. If anyone has been to Amazon, it would work much like their
recommended product feature. What I want to do is take several users lists of whatever but for this
example, I'll use web links like from the browser history. I would want to suggest links to a
user based on common links in many other users lists. User A: Amazon, Ebay, Excite, Google, Yahoo,
MySpace, Walmart User B: Amazon, Ebay, Google, Yahoo, You Tube, MySpace, CVS User C: Amazo....
Anyone Know Of A Really Good Mysql Class?
Looking for something easy but full featured. (4) Generally speaking, when I write a script, it either utilizes the MySQL class of the parent system
(like Mambo or Joomla) or I use basic functions and snippets to perform the database queries I need.
I really like the Joomla database class as it allows you to simply pass a regular query string to
it and the data is returned without the need for extra work! The Invision Power Board (IPB)
database class which is what is used for this forum is kind of a pain to use since it wants the
query string in a non-MySQL standard format. Nonetheless, it does work and I could u....
Five Common Php Database Problems
(0) I just read this excelent article from the IBM's developerWorks website, it's name is Five
common PHP database problems . This article shows five database problems that occur in PHP
applications as well as their solutions and include database schema design, database access, and the
business logic code that uses the database. It is a bit older -a year ago more or less- but i
think that can be helpful for everybody that works with PHP and MySql. Best regards,....
Something Wrong With This Script?
Unexpected T_SRING (9) Here is the code that I have: CODE <?php $con =
mysql_connect("localhost","user","password"); if
(!$con) {die('<p>Could not connect: ' .
mysql_error() . '</p>');} mysql_select_db("database",
$con); $ip=$_SERVER['REMOTE_ADDR']; echo "Adding MXP
info..."; mysql_query (INSERT INTO mxp (date, user, victim, turns, side, gold, lost,
killed, mxp, points_b, points_a, type, power, ip) VALUES (....
Extracting Mysql Maths Using Php
(2) Right, this is a really simple thing and it has me completely stumped. I'm working on this mini
maths function and for some reason i cannot seem to do some simple math process using mysql. This is
the code: (php btw), now assume that $date is actually a defined mysql date variable already
successfully extracted. $sql = mysql_query("SELECT TO_DAYS('CURDATE()') -
TO_DAYS('$date')"); while ($row = mysql_fetch_array($sql)){ $diff =
$row ; } Can anyone spot what im doing wrong becuase im just thrown by it.....
Too Many Connections?
mysql_connect() (4) I uploaded my PHP game yesterday, and most of my friends tried it out. After a while, I tried to
play as well but it said that mysql_connect() had too many connections already. Can anyone tell me
how to increase the amount of connections or maybe the total amount of connections allowed?....
Automatic/remote Php Script Execution
(9) Hi, I was wondering, is it possible to execute a PHP script when a user isn't on the page with
it? Say for example, have it so that a script checks that if a certain time has passed since a user
was last active, it logs them off? So that if they've closed the window, it doesn't keep
them marked as logged in. Also, is there any way, with PHP to alert a user when something changes,
as soon as it happens? Say that if they recieve a new message, a box pops up telling them? You could
do this with Ajax I suppose, but (correct me if I'm wrong) continually runni....
PHP & MySQL: Displaying Content From A Given ID
(6) Okay so I got this sample link (not working): http://www.acosta.com/joo.asp?id=654 Now suppose
I have a PHP file that would use MySql in order to get all values in the row where id 654 is found.
Here's a sample DB: Table: demnyc ______________________________________ | id |
Name | Age | Email | *----------------------------------------------------* | 1
| Albert | 17 | no email |
*----------------------------------------------------* | 2 | YaPow | 888 |
no email | |__________....
What Would Make A Good Registration Script?
(4) I see newbies all the time looking for either a login script or after a little querying you find
they really would like to have a registration script. The first thing for such a script for a
members area would of course be a form and being kind of old fashioned I still like to format my
forms with a table but I do use inline CSS to make it a little nicer. I never did like forms that
had an asterick * by a field and then a Note: Fields marked with * are required. So what I do
instead is add a background color to those areas and then use a CSS background color statin....
[PHP + MySQL] Encrypting Data
To protect the password of your DB, for example. (9) Hi! This is my 2nd code of PHP + MySQL. This code is VERY simple: it encript the data in the
MySQL DB. Here we go! ------------------------------------------------------------------------
CODE <?php $password = "abc"; $new_password = md5($password);
echo $new_password; ?> The password "abc" was codfied using md5() This will be:
900150983cd24fb0d6963f7d28e17f72 CODE <?php $normal_pass = "abc";
$encripted_pass = "900150983cd24fb0d6963f7d28e17f72"; if(md5($norm....
Php Script To Download File From Another Site
(9) hi i need a php or java script code for downloading files from other sites to my site for example:
http://download.com/file.zip to http://mysite.com/file.zip thanks....
Trainable Anti-spam Filter Script
Any clues howto write one/get one ? (3) Hi all, Does anybody have ideas about writing trainable anti-spam mail filters - that you can
add onto any web-mail script ? Looking for something written in perl/php that'll allow me to
just check the checkboxes beside spam mails and click any button (say, "mark as spam") and the
script studies the mail headers and creates its own list of originating spammer domains/ips & blocks
out mails from 'em ? Thanks /smile.gif' border='0' style='vertical-align:middle'
alt='smile.gif' /> ....
Looking for php, mysql, registration, script, insert, database
|
|
Searching Video's for php, mysql, registration, script, insert, database
|
advertisement
|
|