PC Nerd
Members-
Posts
1,122 -
Joined
-
Last visited
Never
Everything posted by PC Nerd
-
[SOLVED] UPDATE querys mot working, but SELECT querys work
PC Nerd replied to PC Nerd's topic in PHP Coding Help
ok, this page sensors words, but i will sensor the sensor list . <?php require("inc_files/Database_link.inc"); require("inc_files/Page_Data.inc"); function sensor_words() { $New_Message = $_POST['Message_Body']; $Sensor_list = array("#######"); $Sensor_Char_list = array("!", "@", "#", "$", "%", "^", "&", "*"); $loop = 1; while($loop<=4) { $Sensor_Char_Index = rand(0, ; $Sensor_Char_Replace = $Sensor_Char_Replace . $Sensor_Char_list[$Sensor_Char_Index]; $loop ++; } #$New_Message = str_replace(); #$Sensor_Char_Replace = rand($Sensor_Char_list, 1).rand($Sensor_Char_list, 1).rand($Sensor_Char_list, 1).rand($Sensor_Char_list, 1); foreach($Sensor_list as $Sensor_Word) { $New_Message = str_replace($Sensor_Word, $Sensor_Char_Replace, $New_Message); return $New_Message; } $New_Message = sensor_words(); $to_Name = $_POST['To_Name']; $to_ID = $_POST['To_ID']; $from_Name = $_POST['From_Name']; $from_ID = $_POST['From_ID']; $Subject = $_POST['Subject']; #$Message_SQL = "INSERT INTO individual_messages ( `User_ID` , `To` , `From` , `From_ID` , `Message_Body` ) VALUES($to_ID, $to_Name, $from_Name, $from_ID, $New_Message)"; $Message_SQL = "INSERT INTO individual_messages ( `User_ID` , `To` , `From` , `From_ID` , `Subject` , `Message_Body` ) VALUES ('".$to_ID."', '".$to_Name."', '".$from_Name."', '".$from_ID."', '".$Subject."' , '".$New_Message."')"; $Message_Query = mysqli_query($Message_SQL, $DB_Server) or die(mysql_error()); # or die("ERROR 14 Your Message could not be sent"); } hopefully this helps thankx -
[SOLVED] UPDATE querys mot working, but SELECT querys work
PC Nerd replied to PC Nerd's topic in PHP Coding Help
no error -
[SOLVED] UPDATE querys mot working, but SELECT querys work
PC Nerd replied to PC Nerd's topic in PHP Coding Help
im running mysql v 5.1 or something liek that. i know its right cos its the same for every other query on the site. all the SELECT queries use it and they work -
[SOLVED] UPDATE querys mot working, but SELECT querys work
PC Nerd replied to PC Nerd's topic in PHP Coding Help
this is the code its checked the variables and eched them so theyre fine. $Message_SQL = "INSERT INTO individual_messages ( `User_ID` , `To` , `From` , `From_ID` , `Subject` , `Message_Body` ) VALUES ('".$to_ID."', '".$to_Name."', '".$from_Name."', '".$from_ID."', '".$Subject."' , '".$New_Message."')"; $Message_Query = mysqli_query($Message_SQL, $DB_Server); -
[SOLVED] UPDATE querys mot working, but SELECT querys work
PC Nerd replied to PC Nerd's topic in PHP Coding Help
ok thanks but that didnt help. i know that all my SELECT queryes work, becauase theyre displayed on the page, without error. does anyone else have any ideas whats happening. the query (mysqli_query()) works becauase its not returning an error. I dont know whether its relevent, but when i echo the variable that contains the result of the query, its empty. thanks.. anything else??? -
[SOLVED] UPDATE querys mot working, but SELECT querys work
PC Nerd posted a topic in PHP Coding Help
hi guys ive got the following query, it doesnt submit to the database, but it doesnt return an error??? ive got no idea whats happenig. $Message_SQL = "INSERT INTO individual_messages ( `User_ID` , `To` , `From` , `From_ID` , `Subject` , `Message_Body` ) VALUES ('".$to_ID."', '".$to_Name."', '".$from_Name."', '".$from_ID."', '".$Subject."' , '".$New_Message."')"; can anyone spot an error???, thankx -
im receiving this error: Catchable fatal error: Object of class mysqli_result could not be converted to string in FILE on line 137 my code on this line is: $New_Player_SQL = "INSERT INTO Ice_Ages (User_ID, 1_00) VALUES('$User_ID', 1)"; $New_Player_Query = mysqli_query($DB_Server, $New_Player_SQL) or die("ERROR 4 Your account has not been created on all of the tables in the Databse. Please contact staff to either cancel your sign up, or to somplete your sign up."); the line with the error defines $New_Player_SQL; i know that my mysqli when starts has no socket connection but has a port do you knwowhats haqppenig??? thankx
-
both of those are the same ????, whats the problem, can you explain it please
-
an extremely remote geuss is that: if your working ona network, (the proxy) the proxy may be blocking or accidently changeing the POST data when your useing myadmin it sound like the proxy is getting in the way to me, but i really dont know good luck
-
also try $query = "SELECT pass FROM ".$my_table ".WHERE user='".$col_value."'"; good luck
-
on the html page create a text are, and username field etc. send it to the php page as post eg PHP page: message = $_POST[mesage] mail(header, to, message) its a really rough start to how youd do, it but look at the mail function generally this works simply unless theres a smpt server or something you have to go via etc. im dont know much more goodluck
-
hi guys i know you dont want to just debug scripts, but i cant find the error in this script: <?php require("inc_files/Database_link.inc"); require("inc_files/Page_Data.inc"); #function sensor_words($Body) { #$Sensor_Words = array("###", "###", "###"); #$Sensor_Char = array("!", "@", "#", "$", "%", "^", "&", "*"); #$Words = explode($Body, " "); #$Periods = explode($Body, "."); #foreach($Periods as $Key => $Period_Word) { # if($Period_Word != ".") { # $Period_Place[] = $Period_Word; # } #} #$Period_Index = 0; #foreach($Words as $Word) { #20 #foreach($Sensor_Words as $Sensor_Word) { #if($Word == $Sensor_Word) { #$Word_len = strlen($Word); #while($Word_Len != 0) { # $Sensord_Word = $Sensord_Word.rand($Sensor_Char); # $Word_Len --; #} #if($Word == $Period[$Period_Index]){ # $Sensord_Message = $Sensord_Message."."; # $Period_Index = $Period_Index + 2; #} #$Sensord_Word = "#$%^"; #$New_Message[] = $Sensord_Word; #} #else { # $New_Message[] = $Word; #} #} #if($Word == $Period[$Period_Index]){ # $Word = $Sensord_Message."."; #40 #} #$New_Message[] = $Word; #} #$New_Message = implode( " ", $New_Message); #echo $New_Message; #$New_Message = str_replace("###", "#$%^", $Body); #} #if(isset($_POST['Message_Body'])) { # $Body = $_POST['Message_Body']; # $New_Message_Out = sensor_words($Body); #} #60 function sensor_words() { $New_Message = $_POST['Message_Body']; $Sensor_list = array("####"); $Sensor_Char_list("!", "@", "#", '$", "%", "^", "&", "*"); $Sensor_Char_Replace = rand($Sensor_Char_list).rand($Sensor_Char_list).rand($Sensor_Char_list).rand($Sensor_Char_list); foreach($Sensor_list as $Sensor_Word) { $New_Message = str_replace($Sensor_Word, $Sensor_Char_Replace, $New_Message); } } #77 ?> <html> ...... html stuff here php code in the body of the page: <?php #120 #$New_Message = sensor_words(); echo "<br><br><br>\n"; echo $New_Message; ?> the error is "Parse error: parse error, unexpected $end in Message_Handler.php on line 142 thanks ps. i know that the way im filtering may not be the best way to do this, but im just starting.thanks
-
hey quick QQQ, my query is below. but its updating every record on the database. whats going wrong. thanks $Upgrade_SQL = "UPDATE Table SET ".$Upgrade_Name." = '1' WHERE User_ID = '".$_COOKIE['User_ID']."'" thankx
-
hi guys im sending multiple querys to a database. basically updating e will boolean values. at the beginning of the script i test to see if the get update variable is true, if it is, it pdates a relevent fied now later in the script it checks this field, along with most others but whats happening is that when that field is checked the second time i the one script, its not changing its output, according to the database, even though ive updated the database. do i have to refresh the script, ie finish the script before re-retreiveing the new details from the database thankx
-
can i send get data as a mulitdimensional array
PC Nerd replied to PC Nerd's topic in PHP Coding Help
thankx -
just like the topic, can i send data in the _GET array, as multidimensional array eg $_GET[index1][index2] = "STRING"; thankx
-
Multi dimensional Array, retreiving index value, not data type
PC Nerd replied to PC Nerd's topic in PHP Coding Help
ok that doesnt work. ill expand on my querstion my array looks like : $Array['Apple']['Name'] = "Fruit"; $Array['Apple']['Price'] = "$2.50"; $Array['Carrot']['Name'] = "Vegetable"; $Array['Carrot']['Price'] = "$1.70"; $Array['Lamb']['Name'] = "Meat"; $Array['Lamb']['Price'] = "$5.50"; now i want to display a table that looks like: Fruit -- Apple -- $2.50 Vegetables -- Carrot -- $1.70 Meat -- Lamb -- $5.50 now my code is: foreach($Array as $index1) { foreach ($index1 as $index2 => $Value) { echo "<tr>\n"; echo "<td width = '25%'>".$index1."</td>\n"; echo "<td width = '25%'>".$Array['$index1']['Name']."</td>\n"; echo "<td width = '25%'>".$Array['$index1']['Price']."</td>\n"; echo "<td width = '25%'>".$Array['$index1']['Type']."</td>\n"; echo "</td>\n"; #echo $Array['$index1']['Name']." => ".$Value."<br>\n"; i may have copied this incorrectly from my printed copy becauase im not at the computer witht e code, but i think its right. whats hayyening is my table just diaplays: Array Array Array Array for all the entries, so if my array was 20 long, then it would display 20 times. so thats haooening is instead if retreiving the name for the embedded array, its retreiving its data type, and therefore not succseefuly its value. could anyone help me on this thankx -
ok, well i have no idea how to fix this error, with the code youve posted here all i can say is that if youve included it from another page, then maybe its that page thats the problem. if you incldue filse, and receive an error, check all of the error line becauase often the error is like "output started line 54 of "INC FILE.inc" Error on line 97 of page 'File that icludes the other'". in that case, your error is in the included file...... so maybe your script actually has a problem with an included file or something like that
-
hi guys. when i use the following code, i echo out $index1. but i get "Array" how can i use this foreach to get the string value of the index??? foreach($ARRAY_EG as $index1) { echo $index1; foreach ($index1 as $index2 => $Value) { echo "<tr>\n"; echo "<td width = '25%'>".$index1."</td>\n"; echo "<td width = '25%'>".$ARRAY_EG['$index1']['Name']."</td>\n"; echo "<td width = '25%'>".$ARRAY_EG['$index1']['Cost']."</td>\n"; echo "<td width = '25%'>".$ARRAY_EG['$index1']['Stock']."</td>\n"; echo "</td>\n"; #echo $ARRAY_EG['$index1']['Name']." => ".$Value."<br>\n"; } } thankx
-
im creating a new user script. but it enters data into multiple tables. can i do this in the one query. or does it need multiple querys for each table? thanx for you help
-
[SOLVED] Lists in PHP, Python list equivalent?????
PC Nerd replied to PC Nerd's topic in PHP Coding Help
thanks -
hi guys, whats the PHP equivalent of the Python List. ie, not an array, but like $LIST = "a", "list", "is", "what", "i", "need"; thanx
-
FALSE ALRAM soz guys its giving me output, although its wrong output. whats happening in some cases is its the inverse operation if !=1 give the output as !=0 but other times, it just defults back to the first if() wthich isnt very good. my database if a bool, but when i manually enter data into the fieldsd as the record im veiwing....... i type true into the boolean fieild and it ends up as 0...... and the same as if i went 1 instead of true. although is sometimes worked if the field was text type with true as the value.... its really patchy, not the same every time.... can you help me Now if i change from == 1 TO !=1, it gives the correct output.... if ($Research['1_00'] == 0) { } else { die ("ERROR 7 "); } if ($Research['1_01'] == 1) { if($Research['1_02'] == 1) { if($Research['1_10'] != 1) { $Res_avail['1_10'] = "True"; } if($Research['1_03'] == 1) { if($Research['1_05'] == "True") { if($Research['1_06'] == "True") { if($Research_['1_07'] != "True") { $Res_Avail = "True"; } if($Research['1_08'] != "True") { $Res_Avail = "True"; } } if($Research['1_09'] != "True") { $Res_Avail['1_09'] = "True"; } } else { $Res_Avail['1_05'] = "True"; } $Res_Avail['1_04'] = "True"; } else { $Res_Avail['1_03'] = "True"; } } else { $Res_Avail['1_02'] = "True"; } } else { $Res_Avail['1_01'] = "True"; } this is the first section of code..... the database ass it stands is a boolean type, and with the values of 1 for 1 - 5, but 6 - onwards ( $Research array) are all text and empty ( NULL) so they should equate to being false ( empty ( if($Research['1_06'] != 1) {will turn true, becauase its NULL in the Database})) thankz
-
ok,that worked thanx sooooooo much
-
its still not working, no matter the data type, or the value ive tried to make it text, and have it case sensitive to "True", boolean, int... i cant seem to fix it thankx 4 ur help thoug, is there anything else???