-
Posts
3,372 -
Joined
-
Last visited
-
Days Won
18
Everything posted by Muddy_Funster
-
from your description, it would normaly be done the other way arround. It would be standard to insert the appropriate DRS_ID refference into the job table as the DRS_ID is specific to the job, not the other way round. still, what can be done is you can add a trigger to the job table that will run after every record insert and will insert values into the drs table. It's effectivly a stored procedure that you don't even have to call once it's in place. can you run the describe command on the tables (using phpMyAdmin or whichever interface you use) and post up the output? Just so I can get a better feel for what you are doing V's what I would reccomend.
-
remove a certain row from results array after query.
Muddy_Funster replied to jason310771's topic in PHP Coding Help
This isn't tested at all, but should give the foundation of what you need. foreach($results as $recKey => $product){ foreach ($product as $prodElem => $prodVal) if($prodElem == "product_id" && $prodVal == $matchToRemove){ $keyToRemove[] = $recKey; } } } foreach($keyToRemove as $key=>value){ unset($results, $key); } -
you will need to femiliarise yourself with a pdf library. I personaly use fpdf.
-
well my suggestion would be that you ignore the column altogether. I don't think you should be updating any columns that you are not actualy updating. remove all refference to your image column from the statement, as well as any other columns that are not actualy being changed and see what happens.
-
have you dumped the query to screen to see that the values being set are accurate at the time of performing the update?
-
both sha1 and md5 are outdated. using a blowfish crypt with self generating salt, similar to the one in my signature, would be the way to go. you shouldn't store hash salts in the database except in very rare occasions, doing so unwittingly can open you up to packet attacks as you are forced to pull the hash and the salt back out of the database to perform the check. stick to using either bindParam or bindValue when attaching values to parameters for prepared statements.
- 5 replies
-
- sha1 encryption
- update password
-
(and 1 more)
Tagged with:
-
Please use code tags when posting code on the forum. A couple of questions - why are you using bindColumn? why are you using sha1? and why are you storing a salt in the database?
- 5 replies
-
- sha1 encryption
- update password
-
(and 1 more)
Tagged with:
-
just use number_format() : $price = number_format($preownedinfo->Price, 2);
-
how about we try again using some code tags??? Oh, and if your pasting that as a single string I suggest you reformat it a bit as well.
-
should be? O_o do a describe of your tables and show me what you are trying to do. I think a triger may be a better way to go, but it depends on a couple of things.
-
well I am deffinately open to suggestions on alternatives, since none are forthcoming on making this work. I wonder why there are so many resources on COMET applications using this setup which completly ignore that it's not supposed to be done....damn internet
-
What is the best way to categorize a product
Muddy_Funster replied to mostafatalebi's topic in PHP Coding Help
you seem to have mixed up categorys and tags. But anyway, given this kind of layout I would have an id/category ref table and match up all id's that the the product matches in a prod-id/cat-id x-ref table that would have only those two columns with them set as a compound PK. -
hang on. do you have a last insert id to get? has there already been an insert performed on the same connection before this is being called?
-
Please help my INSERT and UPDATE scripts have ceased working
Muddy_Funster replied to designsweb's topic in PHP Coding Help
replace the top part of your code upto and including the first failed query and let us know what it gives back. <?php //Connect to the MySQL database include"../scripts/connect_to_mysql.php"; if (!get_magic_quotes_gpc()) { $meta_desc=addslashes($_POST['meta_desc']); $sku=$_POST['sku']; $business_name=addslashes($_POST['business_name']); $address=$_POST['address']; $package=addslashes($_POST['package']); $contact_name=addslashes($_POST['contact_name']); $description=addslashes($_POST['description']); $phone=$_POST['phone']; $e_mail=$_POST['e_mail']; $short_web=$_POST['short_web']; $weblink=$_POST['weblink']; $facebook=$_POST['facebook']; $first_ad=$_POST['first_ad']; $main_menu=$_POST['main_menu']; $category=$_POST['category']; $sub_category=$_POST['sub_category']; $niche_category=$_POST['niche_category']; $display_ad=$_POST['display_ad']; $salesperson=$_POST['salesperson']; $made_live=addslashes($_POST['made_live']); } $insQry = <<<INS_QRY INSERT INTO business_list ( meta_desc, business_name, address, package, contact_name, description, phone, e_mail, short_web, weblink, facebook, first_ad, main_menu, category, sub_category, niche_category, display_ad, salesperson, made_live ) VALUES ( '$meta_desc', '$business_name', '$address', '$package', '$contact_name', '$description', '$phone', '$e_mail', '$short_web', '$weblink', '$facebook', '$first_ad', '$main_menu', '$category', '$sub_category', '$niche_category', '$display_ad', '$salesperson', '$made_live' ) INS_QRY; $sql=mysql_query($insQry) or die ("The Following Query Failed To Run :<br><br>".$insQry."<br><br>The Server resonded with the following error:<br><br><span style=\"font-weight:bold;\>".mysql_error()."</span>"); exit("query was successful"); -
mysql has it's own internal command that gets the last insert id, try this: $sql = "INSERT INTO dataRecSpec(J_RefNum, DRS_Name) VALUES(LAST_INSERT_ID(), '$txt')";
-
I'm trying to proof a comet style page and to start it up I thought I would set a simple counter in PHP to output 0->3 with a one second delay between each output and flush it to screen each second. Problem is nothing I have tried has actualy managed to flush the buffer out. It just sits there with the loading spinner and after 4 seconds dumps the lot onto the screen at once. I have been diging about and have set the nginx config to the following: user www-data; worker_processes 1; error_log /var/log/nginx/error.log; pid /var/run/nginx.pid; events { worker_connections 1024; multi_accept on; } http { include /etc/nginx/mime.types; access_log /var/log/nginx/access.log; sendfile on; tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; tcp_nodelay on; #---------------------------------------------- # fastcgi_keep_conn on; proxy_buffering off; gzip off; #---------------------------------------------- gzip_disable "MSIE [1-6]\.(?!.*SV1)"; include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; } I had to comment out the fastcgi_keep_con on; as this wasn't recognised. The following is the PHP page. <?php ini_set('zlib.output_compression', 'Off'); ini_set('output_handler',""); ini_set('implicit_flush',1); set_time_limit(0); ob_start(); header("Cache-Control: no-cache, must-revalidate"); flush(); ob_flush(); for ($i=0;$i<4;$i++) { echo "$i <br>"; ob_flush(); flush(); sleep(1); } ob_end_clean(); ?> Any ideas what I'm missing here?
-
Creating links to pages based on directory contents
Muddy_Funster replied to still_motion's topic in PHP Coding Help
While I tend to champion Open Source mysqlf, from a buisness point of view it's not always the most cost effective route. When you factor in design, deployment, integration, setup and administration costs you can quite quickly find that you spent more on something that only comes with email support as and when the developer can be bothered to get back to you - not something that is apealing when the thing falls over and the people who pay your wages are staring at you expectantly waiting for you to make it work again. In the context of the origin information I don't think that an Open Source solution is the most desireable option. -
Creating links to pages based on directory contents
Muddy_Funster replied to still_motion's topic in PHP Coding Help
To be honest, with your current systems (IIS, AD and ASP) I'm forced to confess that your best option in my opinion is - and I hate to say it - Sharepoint Server. It's Micro$oft's offering aimed at pretty much exactly what you are trying to do. And as nothing integrates with a microsoft product (i.e. Server OS) quite as well as another M$ product does it's the best option as far as I can see. It also has the benifit of being fairly intuative for people who are used to working in IIS so the learning curv should be minimal. -
when the form is submitted the $_POST array is set - whether there are values in it or not. try empty() for the $_POST['name'] instead
-
there is a short time period after a post is made where you can edit it, after this that's it - it's stuck like that untill freaks close their servers. A moderator or admin has the power to edit existing posts at any time, but other than that your best option is to repost the code inside the code tags and we'll take it from there.
-
How do you access to a variable in a class from another class?
Muddy_Funster replied to JongMin's topic in PHP Coding Help
It all depends on what the value is, which you havn't given enough detail about. But as requinix said (with a great deal more elequence), your thinking about this all wrong. -
if you are getting access denied it meens that you don't have the permissions on the server that you are connecting to to perform the action(s) that you are attempting. It's nothing to do with the script.
-
could you mark the thread as answered and, if at all possible, stick in a summary of the solution for others who may have a simmilar problem in the future?
- 29 replies
-
- sql injection
- mysql server version
-
(and 1 more)
Tagged with:
-
if you fix how you have posted your code the rest of us will actually bother to have a look at it and may even be able to tell you what the problem is. If you want to alienate the majority of the community by ignoring the forum rules though - you go right ahead, far be it from me to hold you back.