Jump to content

Mateobus

Members
  • Posts

    95
  • Joined

  • Last visited

    Never

Posts posted by Mateobus

  1. This is probably an easy question. I want to insert rows into my database. So say i had like an auto increment id, employee_name, and job_description columns in my table.  How would I write the insert query without specifying an ID:

    INSERT INTO job SET values(?, $employee_name, $job_description)

    what should i put as the first argument?
  2. Hello all. I am working on a script right now and I am trying to make it so that it will show the errors. Is there a line that I can add to the top of the script, or a way so that It will only show me the errors for this script and not all of the scripts on my site?

    thanks
  3. Hey all,

    I run a soccer website, and I want to do streaming audio for one of the games. Does anyone know of a good way to do this that isn't too complicated or expensive. I would consider going through a third party company if it wasn't too pricy. I would be expecting somewhere in the neighborhood of 5000 listeners.  Thanks for all the help.
  4. hello I have recently switched to a dedicated server. Since then, My php scripts have outputted huge multi gigabyte files with php notices and errors such as undefined var errors. Is there a way to turn this off so that these files stop eating up my server space? Maybe a php.ini line or something?
  5. Hello all,

    Issue #1)
    I recently switched from a shared hosting plan to a dedicated server. When I switched I switched from php 4 to php 5. All of my scripts seem to run fine, with minimal differences. However, before, if I made a parse error, the error would display on the page, UNEXPECTED ... PARSE ERROR.  Now this no longer happens. If there is a parse error, the page will simply not display. I would like to get the old errors back. Another issue...

    Issue #2) My website takes up about 30 gig including everything. I have about 150 gig of server space which recently filled up completely becasue my error_log file got to about 120GB. The error log contains millions of php errors such as undefined var errors which don't stop the scripts from running, just report stupid errors. One example of these errors is an undefined var in an if statement. here is a sample of the code.

    page.php?
    [code]if ($_GET['some_var'] == '')
    //do something[/code]

    Well, this creates an error if the some_var variable is not set within the URL. But this is stupid because it works correctly, because if it is not set it is also the empty string '', so it performs as I want it to despite accumulating a 120GB file on my server.  Is there anything I can do about that? Is that in any way related to php 4 vs. php 5.

    Issue #3)My scripts, including some that were written in open source by professionals, send out emails automatically (for example to register to a forum). These emails no longer get sent. Is this possibly related to the difference in php versions. Maybe its a firewall thing?

    Any help at addressing any one of these issues is appreciated.
  6. Hello all. I have recently switched from a dedicated plan to a shared hosting plan. Many of my old scripts (including open source scripts) use php to send an automatic email to people in order to register for different sections (much like this forum). Many of my users have complained that they havent recieved the confirmation email. It seems like these php functions are no longer working. Is there something that I need to do to allow this? Any help is appreciated. Thanks.
  7. I am trying to configure my php.ini file so that it displays error. I am not too familiar with this file, but i think that these two lines have someithing to do with displaying errors:

    error_reporting = E_ALL & ~E_NOTICE
    display_errors = On

    is there any other reason why errors would not display?
  8. I just switched from a shared hosting plan to a dedicated server. My old scripts for uploading images never changed however they do not work now. I vaguely remember uncommenting a line in the php.ini file for image uploads. Does anyone know what this may have been. Thank you.
  9. Hello, I have a very complicated script that has many computations involved. I just want to run it once on my server, but it never makes it all the way through. I am not sure why but it keeps timing out, does anyone know what the problem is?
  10. Ok, I have recently changed from a shared hosting plan to a dedicated server. Basically i just transfered all of my files and my database and most everything has worked out right. I have had two issues though.  First, php is not displaying erros such as parse errors, or mysql errors when I run my scripts in my browser. Second, my image upload section no longer works. The database aspect works fine, however the files never physically make it to the server. I am wondering if both of these errors are related to settings in the php.ini file. Does anyone know of a quick solution for these things?  Thanks for listening.
  11. Ken,
    I tried that with no success. Here is the problem, since the string is enclosed by double quotes, it is interpreting the line breaks and carriage returns before it ever gets to the email client.  So I think I want literal characters (single quotes) to be sent to the email client. This still doesn't work though because it shows up as \n in my email client.  Thank you for your help.

    Matt
  12. I want to send a dynamic email, the only problem that I am having is that the line breaks won't work? Does anyone know how to put a line break in an email body? Here is my code:

    $email = "someone@somewhere.com";
    $subject = "Hey";
    $body = "Dear Person,\nHow are you?";
    echo "<a href=\"mailto:$email?subject=$subject&body=$body\">";

    Everything is working except my email client isn't recognizing the line break (\n). I tried html (<br />) as well and that didn't work. Any help is appreciated.
  13. I Am getting a syntax error with this code:

    switch(true){
    case ($owp >= .667){
    $region_points = $region_points+14;
    }
    case (($owp < .667) &&($owp >= .5)){
    $region_points = $region_points+12;
    }
    case (($owp < .5) &&($owp >= .333)){
    $region_points = $region_points+10;
    }
    case ($owp < .333){
    $region_points = $region_points+8;
    }
    }

    I got this from the php.net docs but i guess you can't do this. What is the code to do this idea?  Any help is appreciated.
  14. I have several cities and states listed in a database.  I have recently recieved a google maps api key. I am interested in determining whether or not 2 cities are within approximately 200 miles of one another (so i would want between 200mi and 250mi).  I am actually interested in driving distance and the distance i would get would be the way the crow flies so i would have to check all of the distances in approximately this range.  I am good enough with php to extract the cities and states from my databases, but how do i plug into the api to get this info. Any code is helpful and very appreciated.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.