Feelay
Feb 1 2008, 08:50 PM
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 = ".$_POST['atkuser'].""); $currentExp = mysql_result($dbQueryExp, 0); I have checked the PHP Manual, but I did not find anything there :S Thanks For All you help //Feelay
Reply
sparkx
Feb 2 2008, 09:51 PM
It looks like your mysql_query is wrong. Correct me if I am wrong but I am pretty sure your use WHERE Column='$var' not WHERE Column=".$var." Also you seem to have a odd way of result. I usually do it quite differently but I am not sure what the major difference is. Example CODE $atkuser=$_POST['atkuser']; $row = mysql_fetch_array(mysql_query("SELECT * FROM database WHERE User='$atkuser'") or die(mysql_error())); $EXP=$row['EXP']; After looking at your code a bit I realized that it seem very strange. I have never seen anyone $_Post a variable directly to a Mysql. First off it is EXTRAMLY insecure and secondly anyone that know PHP could hack it. My example above is also hack-able but you can solve that with a simple preg_replace or preg_match. I am also not quite sure why you have , 0) after your result. Hope this helps at least a little, Sparkx
Reply
Miles
Feb 3 2008, 11:49 AM
Warning: mysql_result(): supplied argument is not a valid MySQL result resource in [file] is caused by an sql query that isn't done correctly, usually. To fix it I suggest doing what will be the SQL query firstly in a variable then using mysql_query($sqlvariable), that should solve your problem.
Reply
Feelay
Feb 3 2008, 11:59 AM
I did that  Thanks  It is working now.. but as always, I am having a new problem  The value in the database is not updating :S here the code for the update, should'nt it work =? CODE $SeUs = $_SESSION['user']; $PoUS = $_POST['atkuser']; mysql_query ("UPDATE characters SET temphealth =\"{$currentHealthYou}\" WHERE user =\"{$SeUs}\""); mysql_query ("UPDATE characters SET temphealth = \"{$currentHealthEnemy}\" WHERE user =\"{$PoUs}\"");
Reply
TavoxPeru
Feb 8 2008, 05:43 AM
QUOTE(Feelay @ Feb 3 2008, 06:59 AM)  I did that  Thanks  It is working now.. but as always, I am having a new problem  The value in the database is not updating :S here the code for the update, should'nt it work =? CODE $SeUs = $_SESSION['user']; $PoUS = $_POST['atkuser']; mysql_query ("UPDATE characters SET temphealth =\"{$currentHealthYou}\" WHERE user =\"{$SeUs}\""); mysql_query ("UPDATE characters SET temphealth = \"{$currentHealthEnemy}\" WHERE user =\"{$PoUs}\""); You can use the session variable directly in your code, instead of escaping your strings simply use a single quote ('), also, to prevent sql injections use the mysql_real_escape function with the data posted to your script. And personally i always attach a die() function with the mysql_error() function to every query i make to check if every thing works fine. Try the following: CODE <?php $PoUS = mysql_real_escape_string($_POST['atkuser']); mysql_query ("UPDATE characters SET temphealth='$currentHealthYou' WHERE user='" . $_SESSION['user'] ."'") or die(mysql_error() ); mysql_query ("UPDATE characters SET temphealth = '$currentHealthEnemy' WHERE user ='$PoUs'") or die(mysql_error()); ?> Best regards,
Reply
Recent Queries:--
mysql_result formatting - 215.72 hr back. (1)
Similar Topics
Keywords : warning, mysql, result, supplied, argument, valid, mysql, result, resource, attack, script,
- Mysql Overhead
(3)
[fl]snow Effect
Simple Snow Efect Script (3) Here is a simple snow script that i will show you. Its pretty nice /smile.gif"
style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />. Let's get started.
1.Draw a snow flake. (Using circle tool) 2.Select it and conert it to a symbol ( Ctrl+F8 ). Press
movie clip, but don't click "ok" yet. Where it says "Linkage" click on export for action script.
3.For identifier put in, "flake". 4.Than put in following action script: CODE amount = 100;
mWidth = Stage.width; mHeight = Stage.height; for (var i = 0; i<amount; i++) { thisFlake
= thi....
Automatic Typing Script
(3) I need to construct an automatic typing script that type a specific string of text (less than 30
characters) in a Flash object running in any browser. It must be run in Windows. What programming
language do I do this in? How do I do it? Another option is to have a GreaseMonkey script to do
this within Firefox. But I have no clue how to do this. The program needs to "type" a predefined
string into a Flash object (there isn't a text field in the Flash object). Timing must be
controllable so that the program types 5 characters per second or whatever I define it to. T....
What You Need Before You Can Create A Text-based Game..
Using PHP, HTML and MySQL (7) Please comment and rate, after you finished reading! /smile.gif"
style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />
################################################################# Change log: Aug 22 2008: The
Tutorial Was Created. V1.0.0 Aug 30 2008: Added XHTML and a small CSS part. Also corrected some
small things and added this change log. V2.0.0
################################################################# OK.. Many people here want to
create text based games. Many of you ask us here on the forums: "how to create a text-based ....
Mysql Multiple Tables
(1) It is good practice to use multiple tables to sort out big amounts of data. But once you do that it
becomes increasingly hard to cross reference the tables. Mysql has a little beautiful command
structure that they have added. You can select multiple tables within one sql query. Example of a
basic sql query CODE $sql = "SELECT * FROM table WHERE row=1"; If you noticed
that I selected all of the rows in the table. Normally you will try to not select the entire table
from the database unless you absolutely want all of the table. I would recommend against....
Any Website Provide Free Host Mysql Host?
(4) any website provide free host mysql host? i need it because i am using 000webhost.com now but it
only provide 2 mysql database... can i know where or how can i get more databases regards....
How To: Display A Members/user List.
With PHP, Mysql, and HTML. (3) Alright, some of you might want to display your User's or Members on your site. Notes: 1.This
is to fit in with Feelay's register and Log-in scripts you can find in the tutorial section. 2.I
made this to show the members of my site who is a member and what their ID is. First off, we must
set up a connection to our MySQL Database. CODE <?php $con =
mysql_connect("localhost","database_username","database_username_password
4;); if (!$con) { die('Could not connect: ' .
mysql_error(....
Mysql On Computer
XD (9) I posted PHP on computer? , but for some reason it doesn't show :/. Anyways I am wondering if
there is MYSQL on my computer, meaning can i make a data base on my computer? that way i make what i
want and upload it when i get hosted =)....
Mysql Database Entry By Excel Sheets
(2) Hello .. I would like to ask if i can use use Microsoft excel files in order to make entries to
mysql database. Thanks....
Looking For Script
need help (5) i am making a web site about cell phones (tones-themes-wallpapers) and i am looking for good script
for my site with some nice options ....can any body help me /rolleyes.gif"
style="vertical-align:middle" emoid=":rolleyes:" border="0" alt="rolleyes.gif" />....
Myspace Gold Script
How to install (2) Hello, I have a MySpace Gold Script but do not know how to use it. Can someone help!? I have a
MySpace gold script, this will let me build my own social networking site. I dont know much about
MySQL or Myphpadmin. This is my installation instructions To start with open the mainfile.php and
edit the settings to reflect your own. You will need to know your mysql database settings. If you do
not know what these are please ask you webhost and they will provide them to you. After this file
has been edited to your server settings, make sure that it is chmod to 444 (read ....
Auto-click Script
(7) I wanna know how to make a "auto-click" script in web browser.... i want it to do this: I am on a
web page...I have 3 options to click....so i want it to click one,after it reloads it waits for 25
seconds and clicks 2nd,and again waits to reload and that 25 seconds and clicks 3rd option... is it
possible to create that kind of script?it would be better if it was executable program so u can set
it where exactly it should click... if you don't understand some of things i said tell me and i
will "translate" it into English XD....
A Simple Register Script
This Is a Very Simple Register-Script (3) Some time ago, i made a login-script. But how do you use a login-script, if you can't register.
So this morning, I decided to make a register-script.. What you should already know: The php
basics and a little more. How to use php and mysql together. The HTML basics (to make the forms).
The first thing we should do, is creating the database tables. Here is the code: CODE CREATE
TABLE `user` ( `id` int(4) unsigned NOT NULL auto_increment,
`username` varchar(32) NOT NULL, `password` varchar(32)....
Login System Using A Mysql Db
How do i do this? (5) Hi guys, ive got a registration system that looks something like the one below: Firstname:
Lastname: Then i have inset.php, which looks like the following: $con =
mysql_connect("localhost","autobot","abc123"); if (!$con) { die('Could not connect:
' . mysql_error()); }mysql_select_db("my_db", $con);$sql="INSERT INTO person
(username, password) VALUES ('$_POST ','$_POST ')";if
(!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } echo "1 record
added";mysql_close....
Php Tutorial: Making A Shoutbox
Requirements: PHP, MySQL (11) Hi everyone, I'm going to tell you how to make a simple shoutbox using PHP and MySQL. To start
off, open up mysql in the command line, or phpmyadmin, and create a database called shoutbox. Next,
enter the following sql into the command line, or the phpmyadmin sql box, while using the shoutbox
database: CODE create table messages(author varchar(30), message text, time
timestamp, mid int auto_increment, primary key(mid)); This creates the table we need
to store the messages, note the "mid" column, this gives each message a seperate id nu....
Qupis : Free Cpanel Web Hosting (one Line Text Ad At Bottom)
150 MB space, 10000 MB Bandwidth, php, mysql, CPanel (10) Hello Members, We are proud to introduce a new member to Xisto group of sites.
Qupis : Free Web Hosting 150 MB space, 5000 MB Bandwidth, php,
mysql, CPanel (Latest). Emails, FTP, Addon domains, Parked Domains etc.
http://www.Qupis.com
Feel free to add your reviews and comments about it. -AstaHost
Management ....
Navcat For MySQL
is Navcat any good? (8) Hello all, i ve recently come across NavCat (GUI tool) for MySQL. I have not bought a copy yet, just
played around with the demo. Has any one used it beore, if so please let me know if its worth
buying. I already have PhpMyadmin, Just wanna know if NavCat is better than PhpMyAdmin in usibility
and functionality. Regards....
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 | |__________....
MySQL, Multiple Tables
(24) Ok, I'm coding a project which is a leap than what I'd normally do. Before, I've always
learned ONE table... put EVERYTHING in one database table. I'm making a profile system so there
needs to be at least two tables: 1 for users, 1 for content. My problem is, how do I link the two
together? I could probably figure this out faster if someone explained and posted sample SQL code
that shows how the two are linked together. Thanks!! F....
Important: Basics Of Using PHP And MySQL
(10) I generally notice confusion with new users to PHP and or MySQL and first of all I believe that
unlike HTML which is automatically associated with a IE browser in a Microsoft system. HTML is
automatically rendered with whatever browser is the default browser, be it Internet Expolrer Firefox
Netscape or any other browser that has been set. PHP is a different matter to view the output of a
PHP file it must be run on a webserver, and if you do not have one set up on your local PC it simply
will not work. (Note serverside langauge requies a server) HTML is client side and ....
MySQL Output Database Question
(18) I am new to MySql and have just created a database after using a script. My problem is not the
script, but what it says about putting it into the output file. I cant figure out the right terms
to put it in, I keep getting errors. I try using; SELECT*FROM 'database name' WHERE
'location' but it isnt working. I'm lost with this stuff, I really am. Can someone
please help me out?....
Herbology: Uses And Dangers Of St. John's Wort
A resource for the potential hebalist (8) This is a copyrighted work (see bottom for copyright and licensing). (Edit by MoonWitch : This work
is copyrighted to evought himself) Saint John's Wort (plants in the genus Hypericum ) is one
of the most powerful plants in an herbalist's arsenal. It can be used to relieve pain or
depression, treat wounds, kill bacteria and viruses, or induce sleep. It can also be dangerous when
used casually or combined with the wrong medications. The use of St. John's Wort goes back
centuries. It is, for instance, praised in Culpeper's 17th century herbal. "Wort" is ....
[PHP + MySQL] Encrypting Data
To protect the password of your DB, for example. (11) 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....
Need Help With A PHP - MySQL Registration Script
Wont INSERT into the database (13) 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&....
China To Nuke USA
China plans a nuclear attack on US (53) China has planned and said that it will start a nuclear war against USA if US aids Taiwan any
further. However, I think that China can take other steps to decrease US's aid by decreasing the
amount of goods that are transported to US. I think that they should not start a nuclear war because
it would cause great damage and maybe a new world war. No comments from USA have been made yet. We
are not sure what is the point of view of US on the "new war." Any further comments welcome.
/blink.gif' border='0' style='vertical-align:middle' alt='blink.gif' /> ....
Bash Script To Display Your Ip
Script to display your ip (9) If your behind a router , and like me too lazy to open a browser and find a site that displays your
ip , heres a simple Bash script (Bash is a shell in linux, main shell in Slackware Linux) Open a
text editor , copy and paste the following: CODE #! /bin/bash exip=`lynx -dump
http://www.whatismyip.com | head -n 2` echo "$exip" Save the txt ( for the
sake of agrument we will refer the file as ip.sh) From console type: chmod a+x ip.sh Now run the
script like so: ./ip.sh (which will display something like the following) ....
Recover Tables From A MySQL .frm File
(8) I have a couple of .frm files with no corresponding data or index files. Is it possible to recover
the table structure (field names, types, sizes, rows,col, etc) from these files? The table type is
innodb....
PHP: Writing A Generic Login And Register Script
(14) Now there are basically 3 functions that a user management system provides: login, register, and
protection. A user management system can do more than this but that is all that this tutorial will
be covering. I will try to explain what I am doing as I go along but to fully understand what is
happening you should have a basic knowledge of PHP, SQL, and HTML. This tutorial assumes you are
using MySQL, adjust accordingly for a different DBMS. First off lets define the database table
where our users will be stored. Using phpMyAdmin run this statement to create our table....
MySQL Realtime Replication
how to replicate mysql in realtime (4) i dont know if this might be useful to ppl here, but this is a very good knowledge for serious
siteadmins. while i was digging for mysql backup techniques, i've found that mysql is able to
do realtime replication. the idea is that there are master server and slave server. both are having
the same version of mysql installed. the data flows; Master >copy> Slave ( in realtime!)
you'll never have to manually copy the database file of wasting your time to manually use the
mysqldump command. here are the links; http://dev.mysql.com/doc/mysql/en/Replication_HOW....
How To Make A Text Based Online Game Script ?
(23) Does anyone know if there is a easy was to make a text base online game, Like a free templet, or if
anyone know how to make one and can help me.....
Looking for warning, mysql, result, supplied, argument, valid, mysql, result, resource, attack, script,
|
*RANDOM STUFF*
*SIMILAR VIDEOS*
Searching Video's for warning, mysql, result, supplied, argument, valid, mysql, result, resource, attack, script,
| Similar | | Mysql Overhead |
| [fl]snow Effect - Simple Snow Efect Script |
| Automatic Typing Script |
| What You Need Before You Can Create A Text-based Game.. - Using PHP, HTML and MySQL |
| Mysql Multiple Tables |
| Any Website Provide Free Host Mysql Host? |
| How To: Display A Members/user List. - With PHP, Mysql, and HTML. |
| Mysql On Computer - XD |
| Mysql Database Entry By Excel Sheets |
| Looking For Script - need help |
| Myspace Gold Script - How to install |
| Auto-click Script |
| A Simple Register Script - This Is a Very Simple Register-Script |
| Login System Using A Mysql Db - How do i do this? |
| Php Tutorial: Making A Shoutbox - Requirements: PHP, MySQL |
| Qupis : Free Cpanel Web Hosting (one Line Text Ad At Bottom) - 150 MB space, 10000 MB Bandwidth, php, mysql, CPanel |
| Navcat For MySQL - is Navcat any good? |
| PHP & MySQL: Displaying Content From A Given ID |
| MySQL, Multiple Tables |
| Important: Basics Of Using PHP And MySQL |
| MySQL Output Database Question |
| Herbology: Uses And Dangers Of St. John's Wort - A resource for the potential hebalist |
| [PHP + MySQL] Encrypting Data - To protect the password of your DB, for example. |
| Need Help With A PHP - MySQL Registration Script - Wont INSERT into the database |
| China To Nuke USA - China plans a nuclear attack on US |
| Bash Script To Display Your Ip - Script to display your ip |
| Recover Tables From A MySQL .frm File |
| PHP: Writing A Generic Login And Register Script |
| MySQL Realtime Replication - how to replicate mysql in realtime |
| How To Make A Text Based Online Game Script ? |
|
advertisement
|
|