Hi,
I seem to have a weird issue with the php command mysql_query. I pass 2 arguments the query in a string format (SQL is working properly) and a database ressource which is also good. The problem is that even with good parameters, the mysql_query returns me bogus data
exact code that cause problem
Code: public function execute($query){
$result = mysql_query($query, $this -> ressource);
return $result;
} // execute
the full database object code
Code: class DBconnexion{
private $host; // database url/host
private $user; // database login name
private $pass; // database login password
private $db; // database name
private $ressource; // mysql ressource for database
public function DBconnexion($db_host, $db_user, $db_pass, $db_name){
$this -> host = $db_host;
$this -> user = $db_user;
$this -> pass = $db_pass;
$this -> db = $db_name;
// connect to database
$cnDB = mysql_connect($this -> host, $this -> user, $this -> pass);
mysql_select_db($this -> db, $cnDB);
// store database ressource in database object
$this -> ressource = $cnDB;
} // DBconnexion (constructor)
// getter for database ressource
public function get(){
return $this -> ressource;
} // get_connexion
public function execute($query){
$result = mysql_query($query, $this -> ressource);
return $result;
} // execute
public function number($sqlRessource){
$result = mysql_num_rows($sqlRessource);
return $result;
} // number
public function row($sqlRessource){
$result = mysql_fetch_row($sqlRessource);
return $result;
} // row
} // DBconnexion
Greek characters in php
Hi,I'm making a script and I m using for first time greek characters.I started to write a simple drop down menu that loads some city names from the database. The names are in Greek in the database and
Why is this function returning a false value when it shouldn't be??
This is in an include file. I want it to check a value in an html form and see if it's just white space, is numbers, is empty etc.Code: (text) [Select]<?phpfunction
$_POST variable un-useable
I'm trying to use a $_POST variable in a mysql update statement but i can't use it for some unknown reason i can echo the variable and it outputs the correct value but i cannot use that variable in
send() and recv() parameters confusion
On server Side:
preg-match with a string and numbers
Hi, I can't get the expression to work for my preg_match, what I'd like is for it to match the string, but only if it is accompanied by a letter, not a number. So if a string was found with a number
db entry based on primary key
My "topics" table contains 10 entires*--------------*topicid topic------*--------------* 01 Bye 02 Hi 03 Hello..... 10 Morning*--------------*<?php
sendmail code suddenly not working
Hi Guys, I maintain 3 sites (including my own) I use the following code from a french webmaster that gave me permission to use it. He designed & coded one of them. Now the code seems to have
session_destroy();
new to phpI have a simple login and am trying to write a logout.I set a $_SESSION var to 1 if they are logged in:if(isset($_POST['logname'])){ $UserArr = chk_lgn($_POST['logname'],$_POST['passwd']);
Multiple arrays inside data
Hi,Simple question. I have a column called "array" in my database, and inserted into each field is the following imploded array:Code: mctriangle,570.65,355.1,1,1,0It is an instance of an
Scrolling news bar and MySQL
I am not sure if this is the correct forum to post this on. If not, I apologize. I am still pretty new to PHP. I am editing a website for a friend. He had a news headlines section on his home