ruano84
Members-
Posts
19 -
Joined
-
Last visited
Never
About ruano84
- Birthday 08/13/1984
Contact Methods
-
MSN
troski@gmx.net
-
Website URL
http://www.pixeladas.com
Profile Information
-
Gender
Male
-
Location
Venezuela
ruano84's Achievements
Newbie (1/5)
0
Reputation
-
thanks, brother, thats it!!
-
Thanks, but its the same
-
Hi, Im writing a php application that manage the townhouses in a resort complex. Every unit has a id, and some of them have a numeric-based id, and others an alphanumeric id. When i call the select statement with the "order by" "asc" or "des" option, it orders the records like "win98", i mean: 101 102 103 104 10A101 10A102 10A103 110 111 112 , and not like "XP" (sorry by the names, but that's the order behavior) 101 102 103 104 110 111 112 10A101 10A102 10A103 , that i need. There is some way to fix this? i mean, without the need of braking the digits in separate columns. Thanks for the attention, any help would be appreciated, Atte. Alexis Rodriguez
-
Hi, thanks for answer. In the script i create the table and insert the data, when i select, everything is fine, like a normal table. When i select the same table with the pconnect function (it's supposed to give me a reference of the last one), sometimes output that the table doesn't exists, sometimes it selects but retrieve just the first x rows and sometimes the data is ok. Thanks again, Alexis RR
-
sorry i write it wrong (cant instead of can), but i modified it already.
-
Remove everything after a certain character in a string
ruano84 replied to rossh's topic in PHP Coding Help
Hi, This is a way to do it: [code] <?php $chain="abcde?edcba"; $chr_pos=strpos($chain,"?"); $final_chain=substr($chain,0,$chr_pos); echo $chain; ?> [/code] I Hope it could help you -
Easiest way to repeat code without doing it all again?
ruano84 replied to Michan's topic in PHP Coding Help
Hi, it must be something like this: [code] <?php for($i=0;$i<10;$i++){ $chart=mysql_query('SELECT * FROM vg_charts LEFT JOIN vg_games ON vg_charts.s$i=vg_games.id WHERE type=1 ORDER BY date DESC limit 0, 1'); } ?> [/code] ...the date procedure seems to be ok -
Hi, I am having throuble with a temporary table. I can create it, fill it and even select it, but every time i access it, the data is corrupted. This is the code to create it: (The query is supposed to be ?sec=xx&art=yy&cant=zz) [code] <?php $ref=apache_request_headers(); setcookie("origen",$ref['Referer']); setcookie("query",$_SERVER['QUERY_STRING']); session_start(); if(!isset($_SESSION["nombre"])){ session_write_close(); header("location:ingresar.php"); //To the registration page }else { $dbh=mysql_pconnect ("localhost", "interglo_admin") or die ('I cannot connect to the database because: ' . mysql_error()); mysql_select_db("interglo_Users"); $id=session_id(); parse_str($_COOKIE["query"]); mysql_query("CREATE TEMPORARY TABLE IF NOT EXISTS cart$id (cat char(255),id int, cantidad int)"); mysql_query("INSERT INTO cart$id (cat,id,cantidad) VALUES ('$sec','$art','$cant')"); header("location:".$_COOKIE["origen"]); } ?> [/code] And this is the code for access it: [code] <?php session_start(); if($err==0){ $_SESSION["nombre"]=$row[0]." ".$row[1]; $_SESSION["cedula"]=$row[2]; $_SESSION["fijo"]=$row[3]."-".$row[4]; $_SESSION["cel"]=$row[5]."-".$row[6]; $_SESSION["direccion"]=$row[7]; $_SESSION["email"]=$row[8]; if(isset($_COOKIE["query"])) header("location:add.php?".$_COOKIE["query"]); } if($_SERVER['QUERY_STRING']=="sec=v_cart"){ $dbh=mysql_pconnect ("localhost", "interglo_admin") or die ('I cannot connect to the database because: ' . mysql_error()); mysql_select_db ("interglo_Users"); echo mysql_error(); $res=mysql_query("SELECT * FROM cart$id"); //The shopping cart echo mysql_error(); $aff=mysql_affected_rows(); echo $id." ".$aff."<br>"; echo mysql_error(); if($aff==0){ ?> Aún no has agregado artículos a tu carro de compras.<br> <?php }else{ $dbh1=mysql_connect("localhost","interglo_admin"); mysql_select_db("interglo_productos"); //The products for($i=0;$i<$aff;$i++){ $fetch=mysql_fetch_row($res); echo $i." ".$fetch[0]." ".$fetch[1]."<br>"; $res1=mysql_query("SELECT * FROM ".$fetch[0]." WHERE id=".$fetch[1]); echo mysql_error(); $fetch1=mysql_fetch_row($res1); echo $fetch1[1]." ".$fetch[2]." ".$fetch[3]."<br>"; } } $id=session_id(); [/code] I hope somebody can help me Alexis RR
-
Hi, I am having throuble with a temporary table. I cant create it, fill it and even select it, but every time i access it, the data is corrupted. This is the code to create it: (The query is supposed to be ?sec=xx&art=yy&cant=zz) [code] <?php $ref=apache_request_headers(); setcookie("origen",$ref['Referer']); setcookie("query",$_SERVER['QUERY_STRING']); session_start(); if(!isset($_SESSION["nombre"])){ session_write_close(); header("location:ingresar.php"); //To the registration page }else { $dbh=mysql_pconnect ("localhost", "interglo_admin") or die ('I cannot connect to the database because: ' . mysql_error()); mysql_select_db("interglo_Users"); $id=session_id(); parse_str($_COOKIE["query"]); mysql_query("CREATE TEMPORARY TABLE IF NOT EXISTS cart$id (cat char(255),id int, cantidad int)"); mysql_query("INSERT INTO cart$id (cat,id,cantidad) VALUES ('$sec','$art','$cant')"); header("location:".$_COOKIE["origen"]); } ?> [/code] And this is the code for access it: [code] <?php session_start(); if($err==0){ $_SESSION["nombre"]=$row[0]." ".$row[1]; $_SESSION["cedula"]=$row[2]; $_SESSION["fijo"]=$row[3]."-".$row[4]; $_SESSION["cel"]=$row[5]."-".$row[6]; $_SESSION["direccion"]=$row[7]; $_SESSION["email"]=$row[8]; if(isset($_COOKIE["query"])) header("location:add.php?".$_COOKIE["query"]); } if($_SERVER['QUERY_STRING']=="sec=v_cart"){ $dbh=mysql_pconnect ("localhost", "interglo_admin") or die ('I cannot connect to the database because: ' . mysql_error()); mysql_select_db ("interglo_Users"); echo mysql_error(); $res=mysql_query("SELECT * FROM cart$id"); //The shopping cart echo mysql_error(); $aff=mysql_affected_rows(); echo $id." ".$aff."<br>"; echo mysql_error(); if($aff==0){ ?> Aún no has agregado artículos a tu carro de compras.<br> <?php }else{ $dbh1=mysql_connect("localhost","interglo_admin"); mysql_select_db("interglo_productos"); //The products for($i=0;$i<$aff;$i++){ $fetch=mysql_fetch_row($res); echo $i." ".$fetch[0]." ".$fetch[1]."<br>"; $res1=mysql_query("SELECT * FROM ".$fetch[0]." WHERE id=".$fetch[1]); echo mysql_error(); $fetch1=mysql_fetch_row($res1); echo $fetch1[1]." ".$fetch[2]." ".$fetch[3]."<br>"; } } $id=session_id(); [/code] I hope somebody can help me Alexis RR
-
Help with creating simple php LOGIN session?
ruano84 replied to wesleypipes's topic in PHP Coding Help
Hi, you did forget a ";" $result = mysql_query(" SELECT * FROM 'user' WHERE username = $appusername AND password = $apppassword "); if (mysql_num_rows($result) > 0) { $_SESSION["authenticatedUser"] = $appusername; -
Hi everyone, I am building a php shopping cart system, and i'm trying to use temporary tables. All i want to know is the "lifetime" of a temporary table, i mean, with a permanent connection (mysql_pconnect), how long it'll last, and what're their limitations. Thanks, Alexis RR
-
Variable doesn't work for a table name in PHP/MYSQL?
ruano84 replied to MasksMaster's topic in PHP Coding Help
Have you messenger? I think it could be easier to help you in that way. My email messenger is in my profile. -
Variable doesn't work for a table name in PHP/MYSQL?
ruano84 replied to MasksMaster's topic in PHP Coding Help
I presume that the line: [i]$query = "INSERT INTO $table VALUES (NULL,'$wish','$link','','','')";[/i] is outside of any function, so the problem could be in the posting. Try to test if the index.html is posting the values to view.php. Give a name to the submit button, and at the begining of the code, write: if($[i]buttonname[/i]){ echo 'it is posting'; }else { echo 'it isnt posting'; } -
Variable doesn't work for a table name in PHP/MYSQL?
ruano84 replied to MasksMaster's topic in PHP Coding Help
hi, Be sure that $_POST['first'] is giving you a value, it doesn't seems to. instead of POST use $_REQUEST['first'], and try again. Good luck! -
Retrieve from MySQL a previously encripted string
ruano84 replied to ruano84's topic in PHP Coding Help
Hi, I saw all the code and realize that there was a programming error from me. I was hashing the password 2 times inside a validation process. Thanks for everything