I am doing a start up and am figuring out my stack. I've been using php for around 5 years now and am extremely familiar with it. However, I've recently been introduced to node.js and have seen it is on the rise. I'm not sure what to use for server side.

The purpose of my company is e-commerce. Users will have accounts and subscribe to a service. I hope to grow quickly. Would node.js be a good choice or would php be fine?

Here is a link to a list of college names and their .edu email http://pastebin.com/LND21t5F

I want to take those lines of code and put the .edu part into one coloumn of a database and the name of the college into another coloumn.

My database is structure like this (id, college_email, college_name)

Can some one help me do this?

I have a domain name lets say. mydomain.com and it has a hosting account. But I also have another domain name, mydomain2.com that doesnt have a hosting account. How can I make mydomain2.com go directly to mydomain.com? I am using Host Gator

I have a div that has an image as its background. But the image only covers up about 80% of the screen. I want to make the extra 20% of the screen to be black but its only coming up as white. How can I set the background images and the background color? This is my css,

    background: url(../images/first_section_bg.jpg) no-repeat center center;

How can I make the background color #3d3d3d?

I have an account with Host Gator that allows me to create my own email address's. I created my own email address, lets say its called "myemail@mydomain.com". Now I have a PHP script that automatically send out emails to users but when the emails are sent they are sent by my servers defualt email address. There is no way for me to change my servers default email address so how can I make the PHP mail send emails from the myemail@mydomain.com?

I have a link that once clicked is suppose to make a div visible. So far it does but it only makes the div visible for a second then it returns to being invisible.

I gave the div the value display:none; in Css and the javascript gives it the value display:block; in the onlcick function. Here is my Html and Javascript

function blackBox()

<a href="" style="color:#3d3d3d;" onclick="blackBox()">Terms and Agreements</a>

How can I stop the div from only flashing??

I am trying to create a website where users post onto a forum and leave and email adress so others can respond to the forum post but I want the email adress they leave to be encrypted like Craiglist does. So if my email is myemail@gmail.com it will be posted as ek34jf@gmail.com and people can email the encrypyed email. How can I implement this into my website?

Thanks for the reply, but I don't understand this website. Can you give me a further explanation?

Hello I have a simple for and PHP that uploads multiple images to a file. The problem is I want these images to be resized when they are uploaded. Does anyone know of a simple way to resize these images with PHP? I am not a professional so further explaining would be helpful. Here is my current HTML form and PHP upload script.

    $errors= array();
    foreach($_FILES['files']['tmp_name'] as $key => $tmp_name ){
        $file_name = $key.$_FILES['files']['name'][$key];
        $file_size =$_FILES['files']['size'][$key];
        $file_tmp =$_FILES['files']['tmp_name'][$key];
        if($file_size > 10097152){
            $errors[]='File size must be less than 2 MB';
        $query="INSERT into upload_data (`USER_ID`,`FILE_NAME`,`FILE_SIZE`,`FILE_TYPE`) VALUES('$user_id','$file_name','$file_size','$file_type'); ";
                mkdir("$desired_dir", 0700);        // Create directory if it does not exist
            $file_name = md5($file_name.time());
            $file_name = $file_name.".jpg";
        echo "Success";


<form action="" method="POST" enctype="multipart/form-data">
    <input type="file" name="files[]" multiple/>
    <input type="submit"/>


Hello, I have a few links that I have given a relative position. They have the widths set to 200px, however they do not follow this at all and only have the width wrap around text. When they had the position of float, they followed the width rule of 200px. I have no idea why they are not following the width rule, here is the CSS

ul a{
  font-size: 15px;
  font-family:"Arial Black", Gadget, sans-serif;
  text-decoration: none;
  text-shadow: 3px 3px 3px #333;

Thanks for looking!

This is the HTML

    <li><a href="#" id="toggle1" class="slide_links">Contact Us</a></li>
    <li><a href="contact.asp" id="toggle2" class="slide_links">Parts Inventory</a></li>
    <li><a href="about.asp" id="toggle3" class="slide_links">Boats For Sale</a></li>
    <li><a href="about.asp" id="toggle4" class="slide_links">Marine Services</a></li>

I have a query that collects multple ID numbers and stores them into a php Array. I then want to make a mysql query for every result in the php Array. I believe I am on the right track but am getting an error saying the join() method has invalid arguments. $IdArray is a valid array and does have Ids stored in it, I am 100% sure. Here is my code,

    $secondArray = array();
    $ids = join(',', $IdArray);  
    $query = "SELECT * FROM test WHERE user = '$user' AND id IN ($ids)";
    $results = mysql_query($query);
    while($row = mysql_fetch_array($results)){
        $secondArray[] = "YES";

another problem is I want a piece of information to be stored into $secondArray even if a result hasnt been found. To make it clear lets say the $ids are like this ['0','1','2','3'] and the table test only has the id 2 stored in it. But I want the $secondArray to look like this ['NO','NO','YES','NO']

Okay so I have an android app called Rate My Plate and it needs users. I mean it needs a lot of users. It's an app where if there are a low amount of users then it's pointless but the more users the better it is. Now I have tried posting on some forums but not much luck. Does anyone have any idea where I can post about my app and some people will actually read it? I tried posting here but only got 2 hits.

Thanks for answering at least! lol but I am using a web host so I dont need it on my computer but I have not tried single quotes I can give it a whirl though.

I can not access the database with Mysqli_connect(). I have all the correct information into the funciton but it wont let me. This is the syntack that I use

$link = mysqli_connect("hostname", "username", "password", "db_name");

I get this error

10-01 22:20:27.182: E/JSON(8700): <br />n<b>Warning</b>:  mysqli_connect() [<a href='function.mysqli-connect'>function.mysqli-connect</a>]: (42000/1044): Access denied for user 'username'@'%' to database 'db_name'

OKay so this my have been asked before but I have more of a general question than an issue. I don't understand Mysql_num_rows() becuase I don't have any information within my database table so the number or rows should be 0 but what happens is I get an error and it says that Mysql_num_rows is not a valid argument. How can I find out then if there a piece of data within in a table without using mysql_num_rows()?

Hello, this is a broad question but I need help selecting a webhost. Currently I am with GoDaddy and they are a great hosting site. The problem I have is they only allow 1GB how data to be stored in a database. They do allow unlimited databases but I am not interested in that. I want to have unlimited data storage for my database or at least a significant amount. Does anyone know of a web hosting site where they are no limits on the amount of data allowed to be stored in one mysql database? Or at least a significant amount of data?

How can I replace
, \r, \n with " ". Which is an empty space. Is there a way to detect these characters in a string and replace them with a single white space?

I want to remove all enters from an input and replace them with a single space. By that I mean something as . So if someone places the input like this

Hello, my name is bob.
How are you?

It will look like this,

Hello, my name is bob. How are you?

How can this be done in php?

No, what is array filter?

I have a query that selects data and places it into an array. This array can contain 'null' as a results. I want to remove all the varaibles that say 'null'. I have a code that is suppse to remove all the null variables but instead it replaces them with numbers?

Here is my Code

 $query = "SELECT * FROM test WHERE $info = '$search1' ORDER BY id DESC";
            $results = mysql_query($query);

            while($row = mysql_fetch_array($results)){

                $Array[] = $row['first_names'];
                $Array[] = $row['last_names'];

            }//end while mysql_fetch_array

           foreach (array_keys($Array, 'null') as $key) {

The results I get look like this

[ 1:"Bob", 3:"Smith"]

if I remove the foreach function the results look like this,


I don't know where the numbers are coming from, but don't be confused about me setting the Array[] to different values. I want the first name and last name in serperate quotations. Some people dont have last names so the space is filled with a 'null' and I am trying to remove all the nulls.

Okay I get what to do if i'm only selecting the time but what should the query be if I'm selecting multiple peices of data for example my current Query is

SELECT * FROM comments

So it selects everything how do I get the timestamp in the certain format when my query is written like so.

I have a code that places the time into a database in the format Year-Month-Date Time. The time isnt in Pm or Am. I want to change the code from that into Month/Day/Year and the time in am or pm. Is this possible? Or should I be using a different method to placing the date into the database?

Yes I know about these but I want to have it done without using offset or Rowcount.

I have a database that contains multiple comments. Each comment has their own ID. I want to select 5 comments from the database, store the last comments ID into a variable and then select 5 more comments at a later time. When I collect 5 more comments at a later time I need them to have an ID larger than the previous comments ID that was stored in the variable. I will try to make a code so it is easier to understand.

$commentID = 0;

$query = "SELECT * FROM comments WHERE commentID > '$commentID' LIMIT 5";

I have not tried this code, I want to make sure this is the proper way of doing this before I test it and cant figure out the problem. But another question is if this does work, will it select the next 5 comments in order?
For example the commentID = 5 then will the query select comments with the ID's of 6,7,8,9,10?

Thank you so much! It works perfectly!

I have a mysql query that seperates an array of variables and uses each variables to compare inside the database. The query uses a OR clause and I want to make it so it can also use an AND clause. The trick is I want the left side of the query to use the OR clause and the right side use the OR and AND clause. This probably doesnt make sense so let me try to make an example code.

$query = "SELECT * FROM table WHERE name ='$name' OR (number ='$number' AND number2 = '$number2')";

I have not tried making this code at all because I believe it is beyond my knowledge to even attempt. The sample code may be how you actually do it but I do not know.

Here is my actually query

$query = "SELECT * FROM comments WHERE commenter_username IN (" . join(',', $list) . ") Or Number IN (" . join(',', $list) . ") ORDER BY comment_id DESC";

What I want my code to look like and work would be something like this,

$query = "SELECT * FROM comments WHERE commenter_username IN (" . join(',', $list) . ") Or (Number IN (" . join(',', $list) . ") AND Number2 IN (" . join(',', $list2) . ")) ORDER BY comment_id DESC";

I have a query in php that has an offset in it. I want the offset value to be a variable but I am not sure how to do so. This is my query but it comes up as an error.

$query = "SELECT * 
FROM comments 
    `commenter_username` IN (" . join(',', $list) . ") OR
    `Number` IN (" . join(',', $list) . ") 
ORDER BY `comment_id` DESC
LIMIT 1 OFFSET $offsetNumber";

What is wrong with this?

Thanks for the response! Could the offset number be set to 2, 3, 4 or any other number? Cause I could use this but what if I want thee 3rd highest comment Id number? Would the offset be set to 2 then?

Hello, I have a mysql query

    $query = "SELECT * FROM comments WHERE commenter_username IN (" . join(',', $list) . ") Or Number IN (" . join(',', $list) . ") ORDER BY comment_id DESC";

I want the query to select one row, the row with the highest id. Then store that id into a variable and then select a row thats id is lower than the previous id.

so im thinking it would look something like this

$query = "SELECT * FROM comments WHERE commenter_username IN (" . join(',', $list) . ") Or Number IN (" . join(',', $list) . ") ORDER BY comment_id DESC";

$results = mysql_query($query);
while($row = mysql_fetch_array($results)){
        $commentID = $row['comment_id'];

$query = "SELECT * FROM comments WHERE commenter_username IN (" . join(',', $list) . ") Or Number IN (" . join(',', $list) . ") WHERE comment_id < $commentID LIMIT 1";

This is what I want to happen but I am not sure how this would work. the $list variable is an array that is parsed with a comma so the mysql query can comprehend it.

This is my xml layout for the log in page

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"


        <!--  Logo  -->
    <TextView android:id="@+id/headText"

 <!--  Email TextField -->
<EditText android:id="@+id/loginEmail"

<!--  Password TextField -->
<EditText android:id="@+id/loginPassword"

<!--  Error message -->
        <TextView android:id="@+id/login_error"

<!--  Login Button --> 
<Button android:id="@+id/btnLogin"

<!--  Link to Registration Screen -->
<Button android:id="@+id/btnLinkToRegisterScreen"


I have this in the manifest file


but the screen does not scroll when the keyboard comes up, why is this?